This repository has been archived by the owner on Jan 26, 2024. It is now read-only.
forked from compdemocracy/polis
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.unminified.js
50 lines (48 loc) · 1.73 KB
/
webpack.config.unminified.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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
// Copyright (C) 2012-present, The Authors. This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License, version 3, as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
var path = require("path");
var webpack = require("webpack");
var CompressionPlugin = require('compression-webpack-plugin')
module.exports = {
entry: ["./src/index"],
output: {
path: path.join(__dirname, "dist"),
filename: "admin_bundle.js",
publicPath: "/dist/",
},
resolve: {
extensions: [".js", ".css", ".png", ".svg"],
},
plugins: [
new CompressionPlugin({
test: /\.js$/,
// Leave unmodified without gz ext.
// See: https://webpack.js.org/plugins/compression-webpack-plugin/#options
filename: '[path][base]',
deleteOriginalAssets: true,
}),
new webpack.DefinePlugin({
"process.env.NODE_ENV": JSON.stringify("development"),
}),
],
optimization: {
minimize: false, //Update this to true or false
},
module: {
rules: [
{
test: /\.m?js$/,
exclude: /(node_modules|bower_components)/,
use: {
loader: "babel-loader",
options: {
presets: ["@babel/preset-env"],
},
},
},
{
test: /\.(png|jpg|gif|svg)$/,
loader: "file-loader",
},
],
},
};