-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
40 lines (39 loc) · 1.06 KB
/
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
33
34
35
36
37
38
39
40
const path = require('path'),
webpack = require('webpack'),
merge = require("webpack-merge"),
HtmlWebpackPlugin = require("html-webpack-plugin");
const modeConfig = env => require(`./webpack/webpack.${env}.js`)(env);
module.exports=({mode,presets}={mode: "dev", presets:[]})=>{
return merge({
mode,
entry:"./index.js",
output:{
filename: "./main.js",
},
resolve : {
alias:{
"Components": path.resolve(__dirname,"src/Components"),
"css": path.resolve(__dirname,"./src/css"),
"mocks": path.resolve(__dirname,"./src/__mocks__"),
"utils": path.resolve(__dirname,"./utils"),
"assets" : path.resolve(__dirname,"./assets"),
"src": path.resolve(__dirname,"./src"),
},
modules: [path.resolve(__dirname,"./src"),"node_modules"],
},
plugins: [
new webpack.ProgressPlugin(),
new HtmlWebpackPlugin({
template: path.resolve('./webpack/template.ejs') ,
templateParameters:{
title: "React BoilerPlate v3" // name of the app
},
inject:true,
minify: {
removeComments: true,
collapseWhitespace: true
}
})
]
},modeConfig(mode));
};