forked from Angular-RU/universal-starter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
41 lines (39 loc) · 1.14 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
const path = require('path');
const webpack = require('webpack');
/**
* This is a server config which should be merged on top of common config
*/
module.exports = {
mode: 'development',
externals: [/(node_modules|main\..*\.js)/],
entry: {
// This is our Express server for Dynamic universal
server: './server.ts',
// This is an example of Static prerendering (generative)
prerender: './prerender.ts',
},
resolve: { extensions: ['.js', '.ts'] },
output: {
// Puts the output at the root of the dist folder
path: path.join(__dirname),
filename: '[name].js',
},
plugins: [
new webpack.ContextReplacementPlugin(
// fixes WARNING Critical dependency: the request of a dependency is an expression
/(.+)?angular(\\|\/)core(.+)?/,
path.join(__dirname, 'src'), // location of your src
{}, // a map of your routes
),
new webpack.ContextReplacementPlugin(
// fixes WARNING Critical dependency: the request of a dependency is an expression
/(.+)?express(\\|\/)(.+)?/,
path.join(__dirname, 'src'),
{},
),
],
target: 'node',
node: {
__dirname: false,
},
};