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

Commit 180712f

Browse files
authored
Merge pull request #140 from justcoded/develop
Update error states on build tasks
2 parents 0ae6258 + d89451f commit 180712f

File tree

4 files changed

+26
-4
lines changed

4 files changed

+26
-4
lines changed

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
},

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,10 @@
4343
"gulp-sass": "4.0.2",
4444
"gulp-sourcemaps": "2.6.5",
4545
"htmlhint-stylish": "1.0.3",
46-
"node-notifier": "6.0.0",
46+
"node-notifier": "7.0.0",
4747
"postcss-import": "12.0.1",
4848
"postcss-sort-media-queries": "1.4.23",
49-
"rollup": "2.2.0",
49+
"rollup": "2.7.1",
5050
"rollup-plugin-babel": "4.4.0",
5151
"rollup-plugin-terser": "5.3.0",
5252
"sass": "1.26.3"

tasks/build-js-vendors.js

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,19 +30,32 @@ module.exports = function () {
3030
production ? terser() : null,
3131
],
3232
onwarn(warning, warn) {
33+
// skip certain warnings
34+
if (
35+
warning.code === 'UNUSED_EXTERNAL_IMPORT'
36+
|| warning.code === 'THIS_IS_UNDEFINED'
37+
|| warning.code === 'NON_EXISTENT_EXPORT'
38+
)
39+
return;
40+
3341
throw new Error(warning.message);
3442
},
3543
});
3644

3745
const tempJs = await bundle.write({
3846
file: `./${global.folder.temp}/js/${global.file.vendorJsTemp}`,
39-
format: 'iife',
47+
format: 'esm',
4048
name: 'vendor',
4149
sourcemap: false,
4250
});
4351
const tempJsFileName = tempJs.output[0].fileName;
4452

45-
gulp.src(filesExist([...vendorFiles, `./${global.folder.temp}/js/${tempJsFileName}`]))
53+
gulp.src(
54+
filesExist([
55+
...vendorFiles,
56+
`./${global.folder.temp}/js/${tempJsFileName}`,
57+
]),
58+
)
4659
.pipe(concat(vendorFileName))
4760
.pipe(gulp.dest(`./${global.folder.dev}/js`));
4861
} catch (error) {

tasks/build-js.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,14 @@ module.exports = function () {
2525
production ? terser() : null,
2626
],
2727
onwarn(warning, warn) {
28+
// skip certain warnings
29+
if (
30+
warning.code === 'UNUSED_EXTERNAL_IMPORT'
31+
|| warning.code === 'THIS_IS_UNDEFINED'
32+
|| warning.code === 'NON_EXISTENT_EXPORT'
33+
)
34+
return;
35+
2836
throw new Error(warning.message);
2937
},
3038
});

0 commit comments

Comments
 (0)