Skip to content

Commit 6ae21c3

Browse files
committed
chore: added missing build.esm.js
1 parent ce79dba commit 6ae21c3

File tree

2 files changed

+39
-2
lines changed

2 files changed

+39
-2
lines changed

.gitignore

+2-2
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ obj
4747
.vs
4848
.tscache
4949
*.user
50-
*.js
5150
*.map
5251
!gruntfile.js
5352
node_modules
@@ -76,4 +75,5 @@ packages/**/*.ngsummary.json
7675
pnpm-lock.yaml
7776

7877
packages/**/*js.map
79-
packages/**/*js
78+
packages/**/*js
79+
hooks

build.esm.js

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
const copy = require('recursive-copy');
2+
const through = require('through2');
3+
4+
const options = {
5+
overwrite: true,
6+
expand: true,
7+
dot: true,
8+
junk: true,
9+
filter: ['**/*'],
10+
rename (filePath) {
11+
return filePath.replace(/(.*)\.js(\.map)?$/, '$1.mjs$2');
12+
},
13+
transform (src, dest, stats) {
14+
return through(function (chunk, enc, done) {
15+
const output = chunk.toString().replace(/((?:(?:"file":")| sourceMappingURL=).*)\.js(\.map)?/g, '$1.mjs$2');
16+
done(null, output);
17+
});
18+
},
19+
};
20+
21+
copy('./build/esm', './', options)
22+
// .on(copy.events.COPY_FILE_START, function (copyOperation) {
23+
// console.info('Copying file ' + copyOperation.src + '...');
24+
// })
25+
.on(copy.events.COPY_FILE_COMPLETE, function (copyOperation) {
26+
console.info('Copied to ' + copyOperation.dest);
27+
})
28+
.on(copy.events.ERROR, function (error, copyOperation) {
29+
console.error('Unable to copy ' + copyOperation.dest);
30+
})
31+
.then(function (results) {
32+
console.info(results.length + ' file(s) copied');
33+
34+
})
35+
.catch(function (error) {
36+
return console.error('Copy failed: ' + error);
37+
});

0 commit comments

Comments
 (0)