1
0
Fork 0
mirror of https://github.com/FrankerFaceZ/FrankerFaceZ.git synced 2025-06-28 05:15:54 +00:00

Use the webpack externals configuration directive to prevent bundling any additional copies of Vue. This is basically to make sure the main menu doesn't misbehave.

Modules using vue may need to add the vue module to their load_requires now, as demonstrated in main_menu. If importing .vue files individually, this likely isn't necessary.
This commit is contained in:
SirStendec 2018-04-05 15:44:47 -04:00
parent 75c317eb16
commit 929d669e1d
3 changed files with 10 additions and 1 deletions

View file

@ -28,6 +28,8 @@ export default class MainMenu extends Module {
this.inject('site');
this.inject('vue');
this.load_requires = ['vue'];
//this.should_enable = true;
this._settings_tree = null;

View file

@ -17,7 +17,7 @@ export class Vue extends Module {
}
async onLoad() {
const Vue = this.Vue = (await import(/* webpackChunkName: "vue" */ 'vue')).default,
const Vue = window.ffzVue = this.Vue = (await import(/* webpackChunkName: "vue" */ 'vue')).default,
components = this._components;
this.component((await import(/* webpackChunkName: "vue" */ 'src/std-components/index.js')).default);

View file

@ -16,6 +16,13 @@ module.exports = {
utilities: path.resolve(__dirname, 'src/utilities/')
}
},
externals: [
function(context, request, callback) {
if ( request === 'vue' && ! /utilities/.test(context) )
return callback(null, 'root ffzVue');
callback();
}
],
output: {
chunkFilename: '[name].[chunkhash].js',
path: path.resolve(__dirname, 'dist'),