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

improve compatibility with web bundlers #19

Merged
merged 1 commit into from
Feb 22, 2021
Merged

improve compatibility with web bundlers #19

merged 1 commit into from
Feb 22, 2021

Conversation

aduh95
Copy link
Owner

@aduh95 aduh95 commented Feb 22, 2021

  • With Rollup, it works just fine with the following config:

    import { nodeResolve } from "@rollup/plugin-node-resolve";
    import OMT from "@surma/rollup-plugin-off-main-thread";
    import url from "@rollup/plugin-url";
    
    export default {
      input: "src/index.js",
      output: {
        dir: "output",
        format: "amd",
      },
      plugins: [
        nodeResolve(),
        OMT(),
        url({
          include: "**/*.wasm",
        }),
      ],
    };
  • With Webpack, you need to tweak one or two lines in the code – documented in the comments in this PR.

  • With Parcel, it should just work without any plugin once WebWorkers: Support new Worker( new URL() ) syntax parcel-bundler/parcel#5430 is resolved.

Fixes: #17

@aduh95 aduh95 merged commit 0954a10 into master Feb 22, 2021
@aduh95 aduh95 deleted the bundlers branch February 22, 2021 14:15
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

Successfully merging this pull request may close these issues.

help needed: bundling viz.js with webpack 5
1 participant