extracttextwebpackplugin

how to extract vue files style into one seperate style.css file

感情迁移 提交于 2020-01-13 18:58:20
问题 I'm using vue-loader and by default for each vue files you have one style tag in your view which is not a good thing, according to vue-loader documentation i can do this https://vue-loader.vuejs.org/en/configurations/extract-css.html my webpack-config.js file var path = require('path') var webpack = require('webpack') const ExtractTextPlugin = require("extract-text-webpack-plugin"); module.exports = { entry: './src/main.js', output: { path: path.resolve(__dirname, './dist'), publicPath: '

Unable to HMR (Hot Module Replacement) css/scss with Webpack 2.2.0 and webpack-dev-server 2.2.1

旧街凉风 提交于 2019-12-10 12:37:00
问题 Versions "extract-text-webpack-plugin": "^2.0.0-rc.2", "webpack": "^2.2.0", "webpack-dev-server": "^2.2.1" Issue "extract-text-webpack-plugin": "^1.0.1", "webpack": "^1.14.0", "webpack-dev-server": "^1.16.2" No longer able to HMR css/scss since upgrading to version 2, changing the styles triggers a change (see output sample below) but I have to manually refresh the page to see the changes the page does not auto refresh, also if I make a change to a js file after changing a scss file the

Webpack Extract-Text-Plugin Output Multiple CSS Files (Both Minified and Not Minified)

蹲街弑〆低调 提交于 2019-12-08 12:18:28
问题 I write style in SCSS, and I want to use webpack to build both minified and not minified css files. So I set my webpack.config.js: const path = require('path'); const webpack = require('webpack'); const ExtractTextPlugin = require('extract-text-webpack-plugin'); const extractSASS = new ExtractTextPlugin('assets/styles/[name].css'); const extractMiniSASS = new ExtractTextPlugin('assets/styles/[name].min.css'); module.exports = { entry: './Scripts/main.js', output: { path: path.resolve(_

Output 2 (or more) .css files with mini-css-extract-plugin in webpack

ぃ、小莉子 提交于 2019-12-03 13:04:28
问题 When using webpack 2(or 3), I could write code like: const coreStyles = new ExtractTextPlugin('./styles/core.bundle.css'); const componentStyles = new ExtractTextPlugin('./styles/components.bundle.css'); rules: [ { test: /\.scss$|\.css$/, include: path.resolve(__dirname, './styles/App.scss'), use: coreStyles.extract({ use: ['css-loader', 'sass-loader'] }) }, { test: /\.scss$|\.css$/, exclude: path.resolve(__dirname, './styles/App.scss'), use: componentStyles.extract({ use: ['css-loader',

Output 2 (or more) .css files with mini-css-extract-plugin in webpack

半世苍凉 提交于 2019-12-03 03:58:13
When using webpack 2(or 3), I could write code like: const coreStyles = new ExtractTextPlugin('./styles/core.bundle.css'); const componentStyles = new ExtractTextPlugin('./styles/components.bundle.css'); rules: [ { test: /\.scss$|\.css$/, include: path.resolve(__dirname, './styles/App.scss'), use: coreStyles.extract({ use: ['css-loader', 'sass-loader'] }) }, { test: /\.scss$|\.css$/, exclude: path.resolve(__dirname, './styles/App.scss'), use: componentStyles.extract({ use: ['css-loader', 'sass-loader'] }) } ] And as a result, I got 2 css files in output. How can I reach the same with mini-css