svelte-tailwind-extension-boilerplate icon indicating copy to clipboard operation
svelte-tailwind-extension-boilerplate copied to clipboard

Not working debugging via IDE (like vscode) for typescript based chrome extension

Open rafek1241 opened this issue 2 years ago • 1 comments

Not working debugging via IDE (like vscode) for typescript based chrome extension due to lack of source map within chrome extension.

rafek1241 avatar Mar 26 '22 11:03 rafek1241

If you're looking to add source maps to your output in your rollup.config.js change the typescript plugin to:

typescript({ sourceMap: true }),

And under the output section add:

sourcemap: true,

So it should look like:

export default {
    input: "src/manifest.json",
    output: {
      dir: "dist",
      format: "esm",
      sourcemap: true,
    },
    plugins: [
      // always put chromeExtension() before other plugins
      chromeExtension(),
      simpleReloader(),
      svelte({
        preprocess: sveltePreprocess(),
        compilerOptions: {
          // enable run-time checks when not in production
          dev: !production,
        },
      }),
      postcss({ minimize: production }),
      // the plugins below are optional
      resolve({
        dedupe: ["svelte"],
      }),
      // https://github.com/rollup/plugins/tree/master/packages/commonjs
      commonjs(),
      typescript({ sourceMap: true }),
      // Empties the output dir before a new build
      emptyDir(),
      // If we're building for production, minify
      production && terser(),
      // Outputs a zip file in ./releases
      production && zip({ dir: "releases" }),
    ],
  }

Let me know if this is what you were looking for

kgallimore avatar Apr 13 '22 22:04 kgallimore