-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathwebpack.vendor.js
More file actions
71 lines (64 loc) · 1.51 KB
/
Copy pathwebpack.vendor.js
File metadata and controls
71 lines (64 loc) · 1.51 KB
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
/* eslint-disable */
const path = require('path');
const webpack = require('webpack');
const colors = require('colors');
const ProgressBarPlugin = require('progress-bar-webpack-plugin');
console.log('Building common chunks... Grab a cup of coffee while this is running ;)'.bgMagenta);
const devVendors = [
'react-hot-loader',
'sockjs-client',
'url', 'strip-ansi', 'ansi-regex',
];
module.exports = {
devtool: 'eval-source-map',
entry: {
'vendor': [
...devVendors, 'lodash',
'react', 'react-dom', 'react-native-web',
'redux', 'react-redux',
'babel-polyfill', 'tinycolor2',
],
},
resolve: {
alias: {
'react-native': 'react-native-web',
},
modules: ['node_modules'],
extensions: ['.js']
},
module: {
rules: [
{
test: /\.js?$/,
loaders: ['babel-loader'],
},
{ test: /\.css$/, loader: "style-loader!css-loader" },
{
test: /\.(png|jpg|svg|ttf)$/,
loader: 'file-loader?name=[name].[ext]'
},
{
test: /\.json/,
loader: 'json-loader'
}
],
},
output: {
filename: '[name].cache.js',
path: path.join(__dirname, 'web'),
library: '[name]_lib',
},
plugins: [
new webpack.DllPlugin({
path: path.join(__dirname, 'web/[name]-manifest.json'),
name: '[name]_lib'
}),
new ProgressBarPlugin({
width: 39, complete: '▓'.green.bgGreen, incomplete: ' '.green.bgWhite,
format: 'Build (:bar) (:elapsed seconds)',
summary: false, customSummary: (buildTime) => {
console.log('Build completed after', ` ${buildTime} `.bgGreen);
},
}),
],
};