With a new app built with single-spa Ember, I get the warning: https://single-spa.js.org/error/?code=41 ("single-spa is loaded on the page multiple times") whenever the Ember app mounts. Other single-spa applications are using Webpack, so have externals: ['single-spa'] in their webpack config.
I've tried a few things to accomplish the same in Broccoli, but with no success yet.
- a broccoli-funnel to exclude single-spa from vendor
const EmberApp = require('ember-cli/lib/broccoli/ember-app');
const Funnel = require('broccoli-funnel');
module.exports = function (defaults) {
let app = new EmberApp(defaults, {
/* ...other stuff */
trees: {
vendor: funnel('vendor', {
exclude: ['./node_modules/single-spa/**/*'],
}),
},
});
/* ...other stuff */
return app.toTree();
};
- ember-auto-import pass-through the
externals option to webpack
module.exports = function (defaults) {
let app = new EmberApp(defaults, {
/* ...other stuff */
autoImport: {
webpack: {
externals: ['single-spa'],
},
},
/* ...other stuff */
});
return app.toTree();
};
- some combinations of these two things and ember-auto-import's
exclude option
Practical impact: with multiple instances of single-spa on the page, I have been unable to get navigateToUrl working correctly, so every transition between applications is causing a full page reload.
With a new app built with single-spa Ember, I get the warning: https://single-spa.js.org/error/?code=41 ("single-spa is loaded on the page multiple times") whenever the Ember app mounts. Other single-spa applications are using Webpack, so have
externals: ['single-spa']in their webpack config.I've tried a few things to accomplish the same in Broccoli, but with no success yet.
externalsoption to webpackexcludeoptionPractical impact: with multiple instances of single-spa on the page, I have been unable to get navigateToUrl working correctly, so every transition between applications is causing a full page reload.