Skip to content

Commit 3860510

Browse files
committed
Simplify PUBLIC_URL and publicPath handling
1 parent 7eb6d4e commit 3860510

File tree

1 file changed

+2
-20
lines changed

1 file changed

+2
-20
lines changed

config/webpack.ssr.config.js

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,7 @@ module.exports = function (webpackEnv) {
2727
output: {
2828
...template.output,
2929
filename: 'ssr.js',
30-
libraryTarget: 'commonjs2',
31-
// use '' instead of '/' to make urls relative to base href
32-
publicPath: ''
30+
libraryTarget: 'commonjs2'
3331
},
3432
optimization: {
3533
...template.optimization,
@@ -55,30 +53,14 @@ module.exports = function (webpackEnv) {
5553
name: 'client',
5654
output: {
5755
...template.output,
58-
// use '' instead of '/' to make urls relative to base href
59-
publicPath: ''
6056
},
6157
// filter out some plugins
6258
plugins: template.plugins.filter(plugin =>
6359
[
6460
// seems to break multicompiler dev server watch mode
6561
ForkTsCheckerWebpackPlugin,
66-
// interpolation of '%PUBLIC_URL%' will happen at runtime, not compile time
67-
InterpolateHtmlPlugin,
68-
// this will be replaced by a modified version
69-
webpack.DefinePlugin
7062
].every(pluginClass => !(plugin instanceof pluginClass))
71-
).concat([
72-
// redefine process.env values on the client
73-
new webpack.DefinePlugin({
74-
'process.env': {
75-
// use existing values
76-
...env.stringified['process.env'],
77-
// override with base href
78-
PUBLIC_URL: 'document.getElementsByTagName("base")[0].href'
79-
}
80-
}),
81-
])
63+
)
8264
},
8365
];
8466
};

0 commit comments

Comments
 (0)