Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
rafek1241 opened this issue Mar 26, 2022 · 1 comment

Comments

@rafek1241
Copy link

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

@kgallimore
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants