-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathwebpack.config.js
More file actions
36 lines (35 loc) · 978 Bytes
/
webpack.config.js
File metadata and controls
36 lines (35 loc) · 978 Bytes
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
const path = require('path')
const { buildWebpackConfig } = require('webpack-preset-accurapp')
const { env, setOutput, customConfig } = require('@webpack-blocks/webpack')
module.exports = buildWebpackConfig([
env('production', [
setOutput({
path: path.resolve('./lib'),
filename: 'react-components.js',
// TODO use 'module' when it will be supported
// https://github.com/webpack/webpack/issues/2933
libraryTarget: 'commonjs',
}),
]),
customConfig({
externals: {
// don't include react in the bundle
react: {
root: 'React',
commonjs2: 'react',
commonjs: 'react',
amd: 'react',
},
},
// turn off performance hints
performance: false,
optimization: {
// generate a single file
splitChunks: false,
// don't include every component if the user requires only one
sideEffects: false,
// don't minify
minimize: false,
},
}),
])