Is it possible to use Angular Elements generated from diffrent scripts?
I have 2 projects weather-widget and clock widget which generates their own script(concated a
Just to update this so other users will find a solution. This is now possible using the Angular Custom Webpack Builder.
In angular.json
"architect": {
"build": {
"builder": "@angular-builders/custom-webpack:browser",
"options": {
"customWebpackConfig": {
"path": "./apps/custom-elements/extra-webpack.config.js",
"mergeStrategies": { "externals": "replace" }
},
...
And in the extra-webpack.config.js file add something like this:
module.exports = {
output: {
jsonpFunction: 'webpackJsonpElements',
library: 'elements',
},
}
If it still doesn't work have a go at adding/removing the polyfills from the Polyfills.ts file and adding/removing the custom-elements-es5-adapter.js which you can pull from here