-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathwebpack.client.js
37 lines (36 loc) · 975 Bytes
/
webpack.client.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
const TerserPlugin = require("terser-webpack-plugin");
const path = require("path");
const configRules = require("./webpack.common");
const webpack = require("webpack");
module.exports = Object.assign({}, configRules, {
entry: {
client: "./src/index.js",
},
target: "web",
mode: "production",
output: {
filename: "[name].js",
path: path.resolve(__dirname, "build"),
publicPath: "/",
},
optimization: {
minimize: true,
minimizer: [
new TerserPlugin({
terserOptions: {
ie8: false,
output: {
comments: false,
},
},
sourceMap: true,
extractComments: false,
}),
],
},
plugins: [
new webpack.DefinePlugin({
"process.env.STORYBOOK_GRAPHQL_HOST": JSON.stringify("/graphql"),
}),
],
});