Last active
July 3, 2020 22:06
-
-
Save pmallol/bb524d6e2caa762baed953cb3de589ab to your computer and use it in GitHub Desktop.
Add Webpack configuration file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Add this to a webpack.config.js file | |
const path = require('path'); | |
const MiniCssExtractPlugin = require('mini-css-extract-plugin'); | |
module.exports = { | |
mode: 'development', | |
entry: { | |
site: ['./source/javascripts/site.js'], | |
style: ['./source/stylesheets/site.css.scss'], | |
}, | |
output: { | |
path: path.resolve(__dirname, '.tmp/dist'), | |
filename: '[name].min.js', | |
}, | |
module: { | |
rules: [ | |
{ | |
test: /\.(sa|sc|c)ss$/, | |
use: [ | |
MiniCssExtractPlugin.loader, | |
'css-loader', | |
'sass-loader', | |
], | |
} | |
] | |
}, | |
plugins: [new MiniCssExtractPlugin()], | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment