0

Im trying to create a few custom angular 7 elements/components that i can use on a wide range of customer sites. Fx. Wordpress, Angular front ends and so on.

Setup

I have bundled my angular elements like this for testing:
package.json command:

"build:elements": "ng build --prod=true --outputHashing=none && node build-script.js",

build-script.js:

const fs = require('fs-extra');
const concat = require('concat');    

(async function build() {

    const files =[
        './dist/elements/runtime.js',
        './dist/elements/polyfills.js',
        './dist/elements/main.js',
        './dist/elements/scripts.js'
    ]

    await fs.ensureDir('publish')

    await concat(files, 'publish/elements.js')

    console.info('Elements created successfully!')
})()

The problem

I have created another angular 7 site, where i include the js file in the index file, and i get the following errors: enter image description here

And i only have a blank page then.. :(

Gonçalo Peres
  • 11,752
  • 3
  • 54
  • 83

1 Answers1

0

In the src/polyfills.ts file comment that line below and generate build again

//import 'zone.js/dist/zone';

user1748379
  • 53
  • 1
  • 9