-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild-angular-element.js
More file actions
30 lines (25 loc) · 916 Bytes
/
build-angular-element.js
File metadata and controls
30 lines (25 loc) · 916 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// after consulting with several devs whose opinion I value, having a build script executed from npm was deemed
// a good way to handle exporting the Angular Element. this is similar to a lot of stuff you've seen before -
// nothing new under the sun ...
const fs = require('fs-extra');
const concat = require('concat');
(async function build() {
// todo make this more general purpose
// bundles to be concatenated - no further compression is applied at this point
const files =[
'./dist/rectangle-selector/runtime.js',
'./dist/rectangle-selector/polyfills.js',
'./dist/rectangle-selector/main.js'
];
// WebComponent exported in the 'elements' folder
await fs.ensureDir('elements');
try
{
await concat(files, 'elements/ng-ngon-component.js');
}
catch(err)
{
console.log( "ERROR: ", err );
}
console.info('Successful creation of Angular WebComponent.');
})();