Skip to content

Instantly share code, notes, and snippets.

@pmallol
Last active July 3, 2020 22:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pmallol/bb524d6e2caa762baed953cb3de589ab to your computer and use it in GitHub Desktop.
Save pmallol/bb524d6e2caa762baed953cb3de589ab to your computer and use it in GitHub Desktop.
Add Webpack configuration file
// 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