Skip to content
This repository was archived by the owner on Jun 10, 2025. It is now read-only.

Commit aee1655

Browse files
committed
update build js tasks - add skiping certain warnings & change vendor format to esm. add output error body to console
1 parent 400b0e2 commit aee1655

3 files changed

Lines changed: 24 additions & 2 deletions

File tree

helpers/notifier.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ module.exports = {
1212

1313
console.log(`\u{1b}[31m[ ${title} ]\u{1b}[0m`);
1414
console.log(`\u{1b}[33m${error}\u{1b}[0m`);
15+
console.log(error);
1516

1617
return callback ? callback() : null;
1718
},

tasks/build-js-vendors.js

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,19 +26,32 @@ module.exports = function () {
2626
babel(),
2727
],
2828
onwarn(warning, warn) {
29+
// skip certain warnings
30+
if (
31+
warning.code === 'UNUSED_EXTERNAL_IMPORT'
32+
|| warning.code === 'THIS_IS_UNDEFINED'
33+
|| warning.code === 'NON_EXISTENT_EXPORT'
34+
)
35+
return;
36+
2937
throw new Error(warning.message);
3038
},
3139
});
3240

3341
const tempJs = await bundle.write({
3442
file: `./${global.folder.temp}/js/${global.file.vendorJsTemp}`,
35-
format: 'iife',
43+
format: 'esm',
3644
name: 'vendor',
3745
sourcemap: false,
3846
});
3947
const tempJsFileName = tempJs.output[0].fileName;
4048

41-
gulp.src(filesExist([...vendorFiles, `./${global.folder.temp}/js/${tempJsFileName}`]))
49+
gulp.src(
50+
filesExist([
51+
...vendorFiles,
52+
`./${global.folder.temp}/js/${tempJsFileName}`,
53+
]),
54+
)
4255
.pipe(concat(global.file.vendorJs))
4356
.pipe(gulp.dest(`../${global.folder.build}/js`));
4457
} catch (error) {

tasks/build-js.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,14 @@ module.exports = function () {
2121
babel(),
2222
],
2323
onwarn(warning, warn) {
24+
// skip certain warnings
25+
if (
26+
warning.code === 'UNUSED_EXTERNAL_IMPORT'
27+
|| warning.code === 'THIS_IS_UNDEFINED'
28+
|| warning.code === 'NON_EXISTENT_EXPORT'
29+
)
30+
return;
31+
2432
throw new Error(warning.message);
2533
},
2634
});

0 commit comments

Comments
 (0)