46 lines
863 B
JavaScript
46 lines
863 B
JavaScript
const path = require('path');
|
|
const MiniCssExtractPlugin = require('mini-css-extract-plugin')
|
|
|
|
module.exports = {
|
|
entry: {
|
|
main: './src/index.js',
|
|
setup: './src/setup.js'
|
|
},
|
|
output: {
|
|
path: path.resolve(__dirname, 'dist'),
|
|
filename: 'js/[name].js'
|
|
},
|
|
module: {
|
|
rules: [
|
|
{
|
|
test:/\.js$/,
|
|
exclude: /\/node_modules\//,
|
|
use: {
|
|
loader: 'babel-loader'
|
|
}
|
|
},
|
|
{
|
|
test: /\.s[ac]ss$/,
|
|
use: [
|
|
MiniCssExtractPlugin.loader,
|
|
{
|
|
loader: 'css-loader'
|
|
},
|
|
{
|
|
loader: 'sass-loader',
|
|
options: {
|
|
sourceMap: true,
|
|
// options...
|
|
}
|
|
}
|
|
]
|
|
}]
|
|
},
|
|
|
|
plugins: [
|
|
new MiniCssExtractPlugin({
|
|
filename: 'css/[name].bundle.css'
|
|
}),
|
|
]
|
|
};
|