Skip to content

Commit

Permalink
fix: not recognizing gulpfile.mjs. [fixes #120]
Browse files Browse the repository at this point in the history
  • Loading branch information
spmeesseman committed Feb 6, 2021
1 parent 62fe08c commit 8bc2cbb
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 8 deletions.
4 changes: 3 additions & 1 deletion src/cache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,9 @@ export async function addFolderToCache(folder?: WorkspaceFolder | undefined)
}

if (!cancel && configuration.get<boolean>("enableGulp")) {
await buildCache("gulp", "gulp", "**/[Gg][Uu][Ll][Pp][Ff][Ii][Ll][Ee].[Jj][Ss]", folder, false);
await buildCache("gulp", "gulp", "**/[Gg][Uu][Ll][Pp][Ff][Ii][Ll][Ee].[JjTt][Ss]", folder, false);
await buildCache("gulp", "gulp", "**/[Gg][Uu][Ll][Pp][Ff][Ii][Ll][Ee].[Mm][Jj][Ss]", folder, false);
await buildCache("gulp", "gulp", "**/[Gg][Uu][Ll][Pp][Ff][Ii][Ll][Ee].[Bb][Aa][Bb][Ee][Ll].[JjTt][Ss]", folder, false);
}

if (!cancel && configuration.get<boolean>("enableMake")) {
Expand Down
5 changes: 4 additions & 1 deletion src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ async function processConfigChanges(context: ExtensionContext, e: ConfigurationC

if (e.affectsConfiguration("taskExplorer.enableGulp")) {
await registerFileWatcher(context, "gulp", "**/[Gg][Uu][Ll][Pp][Ff][Ii][Ll][Ee].[JjTt][Ss]", false, configuration.get<boolean>("enableGulp"));
await registerFileWatcher(context, "gulp", "**/[Gg][Uu][Ll][Pp][Ff][Ii][Ll][Ee].[Mm][Jj][Ss]", false, configuration.get<boolean>("enableGulp"));
await registerFileWatcher(context, "gulp", "**/[Gg][Uu][Ll][Pp][Ff][Ii][Ll][Ee].[Bb][Aa][Bb][Ee][Ll].[JjTt][Ss]", false, configuration.get<boolean>("enableGulp"));
refresh = true;
}
Expand Down Expand Up @@ -336,7 +337,9 @@ async function registerFileWatchers(context: ExtensionContext)
}

if (configuration.get<boolean>("enableGulp")) {
await registerFileWatcher(context, "gulp", "**/[Gg][Uu][Ll][Pp][Ff][Ii][Ll][Ee].[Jj][Ss]");
await registerFileWatcher(context, "gulp", "**/[Gg][Uu][Ll][Pp][Ff][Ii][Ll][Ee].[JjTt][Ss]");
await registerFileWatcher(context, "gulp", "**/[Gg][Uu][Ll][Pp][Ff][Ii][Ll][Ee].[Mm][Jj][Ss]");
await registerFileWatcher(context, "gulp", "**/[Gg][Uu][Ll][Pp][Ff][Ii][Ll][Ee].[Bb][Aa][Bb][Ee][Ll].[JjTt][Ss]");
}

if (configuration.get<boolean>("enableMake")) {
Expand Down
12 changes: 6 additions & 6 deletions test-files/gulp/gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@ const { series } = require('gulp');

// The `clean` function is not exported so it can be considered a private task.
// It can still be used within the `series()` composition.
function clean(cb) {
console.log('clean!!!');
function clean3(cb) {
console.log('clean3!!!');
cb();
}

// The `build` function is exported so it is public and can be run with the `gulp` command.
// It can also be used within the `series()` composition.
function build(cb) {
console.log('build!!!');
function build3(cb) {
console.log('build3!!!');
cb();
}

exports.build = build;
exports.default = series(clean, build);
exports.build3 = build;
exports.default3 = series(clean, build);
18 changes: 18 additions & 0 deletions test-files/gulp/gulpfile.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
const { series } = require('gulp');

// The `clean` function is not exported so it can be considered a private task.
// It can still be used within the `series()` composition.
function clean2(cb) {
console.log('clean2!!!');
cb();
}

// The `build` function is exported so it is public and can be run with the `gulp` command.
// It can also be used within the `series()` composition.
function build(cb) {
console.log('build2!!!');
cb();
}

exports.build2 = build;
exports.default2 = series(clean, build);
18 changes: 18 additions & 0 deletions test-files/gulp/gulpfile.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
const { series } = require('gulp');

// The `clean` function is not exported so it can be considered a private task.
// It can still be used within the `series()` composition.
function clean(cb) {
console.log('clean!!!');
cb();
}

// The `build` function is exported so it is public and can be run with the `gulp` command.
// It can also be used within the `series()` composition.
function build(cb) {
console.log('build!!!');
cb();
}

exports.build = build;
exports.default = series(clean, build);

0 comments on commit 8bc2cbb

Please sign in to comment.