forked from Graylog2/graylog2-server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.vendor.js
36 lines (31 loc) · 925 Bytes
/
webpack.vendor.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
// webpack.config.js
const webpack = require('webpack');
const path = require('path');
const Clean = require('clean-webpack-plugin');
const ROOT_PATH = path.resolve(__dirname);
const BUILD_PATH = path.resolve(ROOT_PATH, 'build');
const MANIFESTS_PATH = path.resolve(ROOT_PATH, 'manifests');
const vendorModules = require('./vendor.modules');
console.log('Building vendor bundle.');
const webpackConfig = {
entry: {
//app: APP_PATH,
//config: 'config.js',
vendor: vendorModules,
},
output: {
path: BUILD_PATH,
filename: '[name].js',
publicPath: '/',
library: '__[name]',
},
plugins: [
new Clean([path.resolve(BUILD_PATH, 'vendor.*.js')]),
new webpack.DllPlugin({
path: path.resolve(MANIFESTS_PATH, '[name]-manifest.json'),
name: '__[name]',
}),
],
recordsPath: path.resolve(ROOT_PATH, 'webpack/vendor-module-ids.json'),
};
module.exports = webpackConfig;