esbuild-coffeescript icon indicating copy to clipboard operation
esbuild-coffeescript copied to clipboard

how combine esbuild-svelte and esbuild-coffeescript ?

Open MatrixFr opened this issue 2 years ago • 0 comments

I try to use coffeescript in svelte on my rails app and i don't understand how merge both :

#!/usr/bin/env node

const watch              = process.argv.includes("--watch");
const esbuild            = require('esbuild')
const coffeeScriptPlugin = require('esbuild-coffeescript');
const esbuildSvelte      = require('esbuild-svelte');
const sveltePreprocess   = require('svelte-preprocess');

esbuild
  .build({
    entryPoints: ["app/javascript/svelte_src.js"],
    bundle: true,
    outfile: "app/assets/builds/svelte.js",
    plugins: [
      esbuildSvelte({
        preprocess: sveltePreprocess(/*{coffeescript: { bare: true }}*/),
      }),
      coffeeScriptPlugin({bare: true}),
    ],
    logLevel: "debug",
    watch: watch
  })
  .catch(() => process.exit(1));

I tried add plugin at the different place, but not working

MatrixFr avatar Jul 02 '22 14:07 MatrixFr