Last active
January 15, 2021 11:44
-
-
Save m00zi/2e4df8993c6b2b778823d689fbe4658a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// npm install fs-extra concat --save-dev | |
// place this file in the root of project next to angular.json | |
const fs = require('fs-extra'); | |
const concat = require('concat'); | |
(async function build() { | |
const files = [ | |
'./dist/app/runtime.js', | |
'./dist/app/polyfills.js', | |
'./dist/app/main.js', | |
] | |
await fs.ensureDir('elements') | |
await concat(files, './elements/counter.js'); | |
await fs.copy('./dist/app/styles.css', 'elements/styles.css') | |
})(); | |
// Add this line to package.json under script | |
"build:elements": "ng build --prod --output-hashing none && node concatenate.js" | |
// npm run build:elements |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment