-
Notifications
You must be signed in to change notification settings - Fork 1
/
webpack.config.js
43 lines (36 loc) · 1.01 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
// PROD
import webpack from 'webpack'
// import MiniCssExtractPlugin from "mini-css-extract-plugin"
import fs from 'fs'
import { __dirname, config, output } from './webpack.common.js'
const packageJSON = JSON.parse(fs.readFileSync('./package.json'))
export default env => {
if (env.production) {
console.log('Producing production build...')
return {
...config,
entry: './src/index',
mode: 'production',
output: { ...output, path: __dirname + '/lib', clean: true },
optimization: {
minimize: true,
},
experiments: {
outputModule: true,
},
plugins: [
new webpack.DefinePlugin({
'process.env.NODE_ENV': JSON.stringify('production'),
}),
new webpack.BannerPlugin(` Log Right Here, Right Now! HyperLog v${
packageJSON.version
}
/ a research project /
by Peiling Jiang at Creativity Lab UCSD (c)
https://creativity.ucsd.edu/
${new Date().getFullYear()}
MIT License`),
],
}
}
}