forked from yarnpkg/website
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.config.js
More file actions
41 lines (40 loc) · 986 Bytes
/
webpack.config.js
File metadata and controls
41 lines (40 loc) · 986 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
37
38
39
40
41
const path = require('path');
const webpack = require('webpack');
const ManifestPlugin = require('webpack-manifest-plugin');
const CleanWebpackPlugin = require('clean-webpack-plugin');
module.exports = {
entry: {
common: './js/src/common.js',
documentation: './js/src/documentation.js',
install: './js/src/install.js',
nightly: './js/src/nightly.js',
search: './js/src/search.js',
},
output: {
path: './js/build',
filename: process.env.NODE_ENV === 'production' ? '[name].[chunkhash].js' : '[name].js',
},
module: {
rules: [
{
test: /\.js$/,
use: [
'babel-loader',
],
exclude: /node_modules/
}
]
},
plugins: [
new webpack.DefinePlugin({
'process.env': {
NODE_ENV: JSON.stringify('production')
}
}),
new webpack.optimize.UglifyJsPlugin(),
new ManifestPlugin({
fileName: '../../_data/webpack.json',
basePath: '/js/build/'
})
]
}