-
Notifications
You must be signed in to change notification settings - Fork 28
/
webpack.config.js
executable file
·61 lines (60 loc) · 1.21 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
const path = require('path');
const webpack = require('webpack');
const CleanWebpackPlugin = require('clean-webpack-plugin')
const ContextReplacementPlugin = require('webpack/lib/ContextReplacementPlugin');
module.exports = {
entry: {
'root-application': 'src/root-application/root-application.js',
'common-dependencies': [
'core-js/client/shim.min.js',
'@angular/common',
'@angular/compiler',
'@angular/core',
'@angular/platform-browser-dynamic',
'@angular/router',
'reflect-metadata',
'react',
'react-dom',
],
},
output: {
publicPath: '/dist/',
filename: '[name].js',
path: path.resolve(__dirname, 'dist'),
},
module: {
rules: [
{
test: /\.js?$/,
exclude: [path.resolve(__dirname, 'node_modules')],
loader: 'babel-loader',
},
{
test: /\.tsx?$/,
loader: 'ts-loader',
},
],
},
node: {
fs: 'empty'
},
resolve: {
modules: [
__dirname,
'node_modules',
],
},
plugins: [
new CleanWebpackPlugin(['dist']),
new webpack.optimize.CommonsChunkPlugin({
name: 'common-dependencies',
}),
new ContextReplacementPlugin(
/(.+)?angular(\\|\/)core(.+)?/,
path.resolve(__dirname, '../src')
)
],
devtool: 'source-map',
externals: [
],
};