2018-03-11 12:16:30 -04:00
|
|
|
const path = require('path');
|
|
|
|
const dev = process.env.NODE_ENV !== 'production';
|
|
|
|
|
2019-02-03 13:21:21 -05:00
|
|
|
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
|
2018-03-11 12:16:30 -04:00
|
|
|
|
|
|
|
const config = {
|
2018-03-17 11:20:15 -04:00
|
|
|
target: 'web',
|
2018-03-17 09:03:13 -04:00
|
|
|
mode: dev? 'development' : 'production',
|
2018-03-11 12:16:30 -04:00
|
|
|
entry: {
|
2019-09-06 18:36:16 -04:00
|
|
|
app: './resources/js/index.js',
|
|
|
|
styles: './resources/sass/styles.scss',
|
|
|
|
"export-styles": './resources/sass/export-styles.scss',
|
|
|
|
"print-styles": './resources/sass/print-styles.scss',
|
2018-03-11 12:16:30 -04:00
|
|
|
},
|
|
|
|
output: {
|
|
|
|
filename: '[name].js',
|
|
|
|
path: path.resolve(__dirname, 'public/dist')
|
|
|
|
},
|
|
|
|
module: {
|
|
|
|
rules: [
|
|
|
|
{
|
|
|
|
test: /\.scss$/,
|
2019-02-03 13:21:21 -05:00
|
|
|
use: [
|
|
|
|
{
|
|
|
|
loader: MiniCssExtractPlugin.loader,
|
|
|
|
options: {}
|
|
|
|
},
|
|
|
|
{
|
2018-03-18 10:47:43 -04:00
|
|
|
loader: "css-loader", options: {
|
2019-02-03 13:21:21 -05:00
|
|
|
sourceMap: dev
|
|
|
|
}
|
2018-03-18 10:47:43 -04:00
|
|
|
}, {
|
|
|
|
loader: "sass-loader", options: {
|
|
|
|
sourceMap: dev
|
|
|
|
}
|
2019-02-03 13:21:21 -05:00
|
|
|
}
|
|
|
|
]
|
2018-03-11 12:16:30 -04:00
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
2018-03-18 10:47:43 -04:00
|
|
|
plugins: [
|
2019-02-03 13:21:21 -05:00
|
|
|
new MiniCssExtractPlugin({
|
|
|
|
filename: "[name].css",
|
|
|
|
}),
|
2018-03-18 10:47:43 -04:00
|
|
|
]
|
2018-03-11 12:16:30 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
if (dev) {
|
|
|
|
config['devtool'] = 'inline-source-map';
|
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = config;
|