snip/webpack.common.js

39 lines
1 KiB
JavaScript
Raw Normal View History

2020-10-26 16:17:00 +00:00
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
const path = require('path');
module.exports = {
entry: {
snip: './snip/templates/index.js',
},
plugins: [
new CleanWebpackPlugin()
],
output: {
filename: '[name].bundle.js',
path: path.resolve(__dirname, 'snip', 'static', 'dist')
},
module: {
2020-10-29 23:59:31 +00:00
rules: [
{
test: /\.css$/i,
use: [
// Creates `style` nodes from JS strings
'style-loader',
// Translates CSS into CommonJS
'css-loader'
]
},
{
test: /\.s[ac]ss$/i,
use: [
// Creates `style` nodes from JS strings
'style-loader',
// Translates CSS into CommonJS
'css-loader',
// Compiles Sass to CSS
'sass-loader',
]
}]
2020-10-26 16:17:00 +00:00
}
};