Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update esbuild from 0.16.X to 0.17.X
- Loading branch information
Showing
6 changed files
with
167 additions
and
167 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 was deleted.
Oops, something went wrong.
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,28 @@ | ||
import * as esbuild from 'esbuild' | ||
import copyStaticFiles from 'esbuild-copy-static-files' | ||
|
||
let minify = false | ||
let sourcemap = true | ||
let watch = true | ||
|
||
if (process.env.NODE_ENV === 'production') { | ||
minify = true | ||
sourcemap = false | ||
watch = false | ||
} | ||
|
||
const config = { | ||
entryPoints: ['./js/app.js'], | ||
outfile: '../public/js/app.js', | ||
bundle: true, | ||
minify: minify, | ||
sourcemap: sourcemap, | ||
plugins: [copyStaticFiles()], | ||
} | ||
|
||
if (watch) { | ||
let context = await esbuild.context({...config, logLevel: 'info'}) | ||
await context.watch() | ||
} else { | ||
esbuild.build(config) | ||
} |
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
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