forked from WonderCMS/wondercms-cdn-files
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
32 lines (31 loc) · 954 Bytes
/
webpack.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
const TerserPlugin = require('terser-webpack-plugin');
const path = require('path');
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
const FixStyleOnlyEntriesPlugin = require("webpack-fix-style-only-entries");
const OptimizeCSSAssetsPlugin = require('optimize-css-assets-webpack-plugin');
module.exports = {
entry: {
'wcms-admin': './wcms-admin.js',
styles: './wcms-admin.css',
},
optimization: {
minimize: true,
minimizer: [new TerserPlugin(), new OptimizeCSSAssetsPlugin({})],
},
output: {
filename: '[name].min.js',
path: path.resolve(__dirname, './'),
},
module: {
rules: [
{
test: /\.css$/,
use: [MiniCssExtractPlugin.loader, "css-loader"]
}
]
},
plugins: [
new MiniCssExtractPlugin({filename: "wcms-admin.min.css"}),
new FixStyleOnlyEntriesPlugin(),
]
};