Extract CSS to a file.
This commit is contained in:
@@ -1,6 +1,12 @@
|
||||
const path = require('path');
|
||||
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
|
||||
|
||||
module.exports = {
|
||||
plugins: [
|
||||
new MiniCssExtractPlugin({
|
||||
name: "[name].css",
|
||||
})
|
||||
],
|
||||
entry: './src/index.js',
|
||||
devtool: "source-map",
|
||||
output: {
|
||||
@@ -12,7 +18,9 @@ module.exports = {
|
||||
rules: [{
|
||||
test: /\.scss$/,
|
||||
use: [
|
||||
"style-loader", // creates style nodes from JS strings
|
||||
{
|
||||
loader: MiniCssExtractPlugin.loader,
|
||||
},
|
||||
"css-loader?-url", // translates CSS into CommonJS
|
||||
"postcss-loader", // Will run auto-prefixer for compatibility
|
||||
"sass-loader" // compiles Sass to CSS, using Node Sass by default
|
||||
|
||||
Reference in New Issue
Block a user