Skip to content

Commit 75955eb

Browse files
committed
fix(vue-router): fix deprecated webpack configuration
1 parent 18a9571 commit 75955eb

File tree

4 files changed

+327
-344
lines changed

4 files changed

+327
-344
lines changed

examples/vue-i18n/nuxt.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ export default {
6363

6464
modules: [
6565
'nuxt-custom-elements',
66-
'nuxt-i18n'
66+
'@nuxtjs/i18n'
6767
]
6868

6969
};

examples/vue-router/nuxt.config.js

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import WebpackDynamicPublicPathPlugin from 'webpack-dynamic-public-path';
12
import pkg from '../../package.json';
23

34
export default {
@@ -29,9 +30,6 @@ export default {
2930
},
3031

3132
customElements: {
32-
webpack: {
33-
publicPathInject: () => global.customPublicPath
34-
},
3533
entries: [
3634
{
3735
name: 'Example',
@@ -40,7 +38,13 @@ export default {
4038
name: 'CustomElementVueRouter',
4139
path: '@/entries/VueRouter'
4240
}
43-
]
41+
],
42+
webpackExtend (config) {
43+
config.output.plugins.push(new WebpackDynamicPublicPathPlugin({
44+
externalPublicPath: 'window.cutomPublicPath'
45+
}));
46+
return config;
47+
}
4448
},
4549
{
4650
name: 'ExampleShadow',
@@ -50,7 +54,13 @@ export default {
5054
name: 'CustomElementVueRouter',
5155
path: '@/entries/VueRouter'
5256
}
53-
]
57+
],
58+
webpackExtend (config) {
59+
config.output.plugins.push(new WebpackDynamicPublicPathPlugin({
60+
externalPublicPath: 'window.cutomPublicPath'
61+
}));
62+
return config;
63+
}
5464
}
5565
]
5666
},

0 commit comments

Comments
 (0)