1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2024-11-24 20:02:35 +01:00
BookStack/webpack.config.js

52 lines
1.3 KiB
JavaScript
Raw Normal View History

2018-03-11 17:16:30 +01:00
const path = require('path');
const dev = process.env.NODE_ENV !== 'production';
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
2018-03-11 17:16:30 +01:00
const config = {
target: 'web',
mode: dev? 'development' : 'production',
2018-03-11 17:16:30 +01:00
entry: {
2019-09-07 00:36:16 +02: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 17:16:30 +01:00
},
output: {
filename: '[name].js',
path: path.resolve(__dirname, 'public/dist')
},
module: {
rules: [
{
test: /\.scss$/,
use: [
{
loader: MiniCssExtractPlugin.loader,
options: {}
},
{
loader: "css-loader", options: {
sourceMap: dev
}
}, {
loader: "sass-loader", options: {
sourceMap: dev
}
}
]
2018-03-11 17:16:30 +01:00
}
]
},
plugins: [
new MiniCssExtractPlugin({
filename: "[name].css",
}),
]
2018-03-11 17:16:30 +01:00
};
if (dev) {
config['devtool'] = 'inline-source-map';
}
module.exports = config;