generated from GrantBartlett/react-typescript-webpack-starter
-
Notifications
You must be signed in to change notification settings - Fork 5
/
env.config.js
57 lines (47 loc) · 1.37 KB
/
env.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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
const outputConfig = {
destPath: "./dist"
};
// Entry points
// https://webpack.js.org/concepts/entry-points/
const entryConfig = [
"./src/App.ts",
"./src/assets/stylesheets/app.scss",
];
// Copy files from src to dist
// https://webpack.js.org/plugins/copy-webpack-plugin/
const copyPluginPatterns = {
patterns: [
{ from: "./src/assets/images", to: "images" },
{ from: "./src/assets/fonts", to: "fonts" },
{ from: "./src/assets/vendor", to: "js" },
]
};
// Dev server setup
// https://webpack.js.org/configuration/dev-server/
const devServer = {
contentBase: outputConfig.destPath,
// https: true,
// port: "8080",
// host: "0.0.0.0",
// disableHostCheck: true
};
// SCSS compile
const scssConfig = {
destFileName: "css/app.min.css"
};
// Production terser config options
// https://webpack.js.org/plugins/terser-webpack-plugin/#terseroptions
const terserPluginConfig = {
extractComments: false,
terserOptions: {
compress: {
drop_console: true,
},
}
};
module.exports.copyPluginPatterns = copyPluginPatterns;
module.exports.entryConfig = entryConfig;
module.exports.scssConfig = scssConfig;
module.exports.devServer = devServer;
module.exports.terserPluginConfig = terserPluginConfig;
module.exports.outputConfig = outputConfig;