-
Notifications
You must be signed in to change notification settings - Fork 795
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* chore: convert to esbuild * chore: convert to esbuild * fix merge * remove dep * async * done on error
- Loading branch information
Showing
6 changed files
with
83 additions
and
1,438 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
const { build } = require('esbuild'); | ||
const path = require('path'); | ||
|
||
module.exports = function(grunt) { | ||
grunt.registerMultiTask( | ||
'esbuild', | ||
'Task to run the esbuild javascript bundler', | ||
function() { | ||
const done = this.async(); | ||
const files = grunt.task.current.data.files; | ||
|
||
files.forEach(file => { | ||
const src = Array.isArray(file.src) ? file.src : [file.src]; | ||
const dest = file.dest; | ||
|
||
src.forEach(entry => { | ||
const name = path.basename(entry); | ||
if (file.cwd) { | ||
entry = path.join(file.cwd, entry); | ||
} | ||
|
||
build({ | ||
entryPoints: [entry], | ||
outfile: path.join(dest, name), | ||
minify: false, | ||
bundle: true | ||
}) | ||
.then(done) | ||
.catch(done); | ||
}); | ||
}); | ||
} | ||
); | ||
}; |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.