How to configure a folder as external in esbuild

54 views Asked by At

I use this to build my plugin/theme. I specify the particular path of an image to set it as external, is there any way to tell all contents inside /plugin/MyPlugin/assets/ are external?

body {
    background-image: url("/plugin/MyPlugin/assets/background.png");
}
const { build } = require('esbuild');

await build({
      entryPoints: ['./src/index.js'],
      bundle: true,
      platform: "browser",
      format: "esm",
      outfile: './dist/bundle.js',
      external: ["/plugin/MyPlugin/assets/background.png"]
});

Or is there anyway to tell esbuild don't give me error when path is not resolved/found?

0

There are 0 answers