Support esbuild 0.24.0

This commit is contained in:
Wout De Puysseleir 2024-10-19 15:07:31 -07:00
parent 9204a5d251
commit 52ca9f8d81
No known key found for this signature in database
GPG key ID: 3DE9371B50FEC46A
5 changed files with 456 additions and 382 deletions

View file

@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## UNRELEASED
### Changed
- Upgraded to esbuild 0.24.0. This requires you to reconfigure the `build.js` file. An example can be found in `example_project/assets/build.js`.
## [0.14.0] - 2024-09-25
### Added

View file

@ -16,7 +16,6 @@ let optsClient = {
outdir: "../priv/static/assets",
logLevel: "info",
sourcemap: watch ? "inline" : false,
watch,
tsconfig: "./tsconfig.json",
plugins: [
importGlobPlugin(),
@ -37,7 +36,6 @@ let optsServer = {
outdir: "../priv/svelte",
logLevel: "info",
sourcemap: watch ? "inline" : false,
watch,
tsconfig: "./tsconfig.json",
plugins: [
importGlobPlugin(),
@ -48,17 +46,17 @@ let optsServer = {
],
}
const client = esbuild.build(optsClient)
const server = esbuild.build(optsServer)
if (watch) {
client.then(_result => {
process.stdin.on("close", () => process.exit(0))
process.stdin.resume()
})
esbuild
.context(optsClient)
.then(ctx => ctx.watch())
.catch(_error => process.exit(1))
server.then(_result => {
process.stdin.on("close", () => process.exit(0))
process.stdin.resume()
})
esbuild
.context(optsServer)
.then(ctx => ctx.watch())
.catch(_error => process.exit(1))
} else {
esbuild.build(optsClient)
esbuild.build(optsServer)
}

View file

@ -16,7 +16,6 @@ let optsClient = {
outdir: "../priv/static/assets",
logLevel: "info",
sourcemap: watch ? "inline" : false,
watch,
tsconfig: "./tsconfig.json",
plugins: [
importGlobPlugin(),
@ -37,7 +36,6 @@ let optsServer = {
outdir: "../priv/svelte",
logLevel: "info",
sourcemap: watch ? "inline" : false,
watch,
tsconfig: "./tsconfig.json",
plugins: [
importGlobPlugin(),
@ -48,17 +46,17 @@ let optsServer = {
],
}
const client = esbuild.build(optsClient)
const server = esbuild.build(optsServer)
if (watch) {
client.then(_result => {
process.stdin.on("close", () => process.exit(0))
process.stdin.resume()
})
esbuild
.context(optsClient)
.then(ctx => ctx.watch())
.catch(_error => process.exit(1))
server.then(_result => {
process.stdin.on("close", () => process.exit(0))
process.stdin.resume()
})
esbuild
.context(optsServer)
.then(ctx => ctx.watch())
.catch(_error => process.exit(1))
} else {
esbuild.build(optsClient)
esbuild.build(optsServer)
}

File diff suppressed because it is too large Load diff

View file

@ -2,7 +2,7 @@
"devDependencies": {
"@types/lodash": "^4.14.192",
"dynamic-marquee": "^2.6.2",
"esbuild": "^0.16.17",
"esbuild": "^0.24.0",
"esbuild-plugin-import-glob": "^0.1.1",
"esbuild-svelte": "^0.7.4",
"lodash": "^4.17.21",