Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
haouarihk committed Feb 12, 2024
1 parent b65c86f commit dfd7bc4
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions esbuild.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,18 @@ const wasmPlugin = (config) => {
};
});
build.onLoad({
filter: /.*/,
namespace: "wasm-deferred"
},
filter: /.*/,
namespace: "wasm-deferred"
},
async (args) => ({
contents: await fs.promises.readFile(args.path),
loader: "file",
})
);
build.onLoad({
filter: /.*/,
namespace: "wasm-embed"
},
filter: /.*/,
namespace: "wasm-embed"
},
async (args) => ({
contents: await fs.promises.readFile(args.path),
loader: "binary",
Expand All @@ -55,7 +55,7 @@ const wasmPlugin = (config) => {

const prod = (process.argv[2] === 'production');

console.log({prod})
console.log({ prod })

esbuild.build({
banner: {
Expand Down Expand Up @@ -90,10 +90,11 @@ esbuild.build({
'@codemirror/text',
'@codemirror/tooltip',
'@codemirror/view',
"node:url",
...builtins
],
format: 'cjs',
watch: prod ? false:{
watch: prod ? false : {
onRebuild(error, result) {
if (error) console.error('watch build failed:', error)
else {
Expand Down

0 comments on commit dfd7bc4

Please sign in to comment.