mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-07-31 15:24:31 +03:00
Moved sass build out of webpack, updated npm deps
Moving sass out of webpack cleans the setup quite considerably and brings a good speed improvement. Made use of npm-run-all so the previous commands still run like before.
This commit is contained in:
@ -1,48 +1,16 @@
|
||||
const path = require('path');
|
||||
const dev = process.env.NODE_ENV !== 'production';
|
||||
|
||||
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
|
||||
|
||||
const config = {
|
||||
target: 'web',
|
||||
mode: dev? 'development' : 'production',
|
||||
entry: {
|
||||
app: './resources/js/index.js',
|
||||
styles: './resources/sass/styles.scss',
|
||||
"export-styles": './resources/sass/export-styles.scss',
|
||||
"print-styles": './resources/sass/print-styles.scss',
|
||||
},
|
||||
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
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
plugins: [
|
||||
new MiniCssExtractPlugin({
|
||||
filename: "[name].css",
|
||||
}),
|
||||
]
|
||||
};
|
||||
|
||||
if (dev) {
|
||||
|
Reference in New Issue
Block a user