]>
BookStack Code Mirror - bookstack/blobdiff - webpack.config.js
projects
/
bookstack
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix missing word
[bookstack]
/
webpack.config.js
diff --git
a/webpack.config.js
b/webpack.config.js
index 7b81dcdfc62cd4a794e409a316c36268096fc2ac..78b679a0a82f51fab622fb35ff60c0dece578119 100644
(file)
--- a/
webpack.config.js
+++ b/
webpack.config.js
@@
-1,9
+1,10
@@
const path = require('path');
const dev = process.env.NODE_ENV !== 'production';
const path = require('path');
const dev = process.env.NODE_ENV !== 'production';
-const
UglifyJsPlugin = require('uglifyjs-webpack-plugin'
);
+const
MiniCssExtractPlugin = require("mini-css-extract-plugin"
);
const config = {
const config = {
+ target: 'web',
mode: dev? 'development' : 'production',
entry: {
app: './resources/assets/js/index.js',
mode: dev? 'development' : 'production',
entry: {
app: './resources/assets/js/index.js',
@@
-17,60
+18,35
@@
const config = {
},
module: {
rules: [
},
module: {
rules: [
- {
- test: /\.js$/,
- exclude: /(node_modules)/,
- use: {
- loader: 'babel-loader',
- options: {
- presets: ['@babel/preset-env']
- }
- }
- },
{
test: /\.scss$/,
{
test: /\.scss$/,
- use: [{
- loader: 'file-loader',
- options: {
- name: '[name].css',
- context: './src/css/',
- outputPath: './',
- publicPath: 'public/'
- }
- }, {
- loader: 'extract-loader', options: {
- publicPath: '',
- }
- }, {
- loader: "css-loader", options: {
+ use: [
+ {
+ loader: MiniCssExtractPlugin.loader,
+ options: {}
+ },
+ {
+ loader: "css-loader", options: {
sourceMap: dev
}
sourceMap: dev
}
- }, {
- loader: 'postcss-loader',
- options: {
- ident: 'postcss',
- sourceMap: dev,
- plugins: (loader) => [
- require('autoprefixer')(),
- ]
+ }, {
+ loader: "sass-loader", options: {
+ sourceMap: dev
+ }
}
}
- }, {
- loader: "sass-loader", options: {
- sourceMap: dev
- }
- }]
+ ]
}
]
},
}
]
},
- plugins: []
+ plugins: [
+ new MiniCssExtractPlugin({
+ filename: "[name].css",
+ }),
+ ]
};
if (dev) {
config['devtool'] = 'inline-source-map';
}
};
if (dev) {
config['devtool'] = 'inline-source-map';
}
-if (!dev) {
- config.plugins.push(new UglifyJsPlugin());
-}
-
module.exports = config;
\ No newline at end of file
module.exports = config;
\ No newline at end of file