-
Notifications
You must be signed in to change notification settings - Fork 1
/
webpack.config.js
56 lines (48 loc) · 1.37 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
const merge = require('webpack-merge')
const path = require('path')
const webpack = require('webpack')
const env = require('./webpack-cfg/env')
const babel = require('./webpack-cfg/babel')
const typescript = require('./webpack-cfg/typescript')
const htmlLoader = require('./webpack-cfg/html-loader')
const postCssLoader = require('./webpack-cfg/postcss')
const fontsImagesLoader = require('./webpack-cfg/fonts-images-loader')
const genIndex = require('./webpack-cfg/gen-index')
const copyFiles = require('./webpack-cfg/copy-files')
const babelMinify = require('./webpack-cfg/babel-minify')
const analyzer = require('./webpack-cfg/analyzer')
const alias = require('./webpack-cfg/alias')
const scopeHoisting = require('./webpack-cfg/scope-hoisting')
const workbox = require('./webpack-cfg/workbox')
const splitChunks = require('./webpack-cfg/split-chunks')
const {ENV} = require('./webpack-cfg/paths')
module.exports = merge.smart(
{
entry: './src/index',
output: {
path: path.resolve(__dirname, 'dist')
},
plugins: [
new webpack.DefinePlugin({
VERSION: JSON.stringify(require('./package.json').version)
})
]
},
env,
alias,
splitChunks,
babel,
typescript,
htmlLoader,
postCssLoader,
fontsImagesLoader,
genIndex,
copyFiles,
analyzer,
...(ENV === 'production' ? [
scopeHoisting,
babelMinify,
workbox
] : [
])
)