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

Support for webpack multiple-configurations #558

Closed
Gozala opened this issue May 5, 2020 · 1 comment · Fixed by #737
Closed

Support for webpack multiple-configurations #558

Gozala opened this issue May 5, 2020 · 1 comment · Fixed by #737

Comments

@Gozala
Copy link
Contributor

Gozala commented May 5, 2020

We would like to produce separate dist of JS-IPFS that would allow sharing node across multiple browsing contexts through SharedWorker API (Contex: ipfs/js-ipfs#3022).

As far as I understand we need webpack with multiple-configurations, new one that targets webworker.

However it appears that using webpack config with multiple configurations is rejected by aegir

aegir build
Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema.
 - configuration[0] has an unknown property '0'. These properties are valid:
   object { amd?, bail?, cache?, context?, dependencies?, devServer?, devtool?, entry?, externals?, infrastructureLogging?, loader?, mode?, module?, name?, node?, optimization?, output?, parallelism?, performance?, plugins?, profile?, recordsInputPath?, recordsOutputPath?, recordsPath?, resolve?, resolveLoader?, serve?, stats?, target?, watch?, watchOptions? }
 - configuration[1] has an unknown property '0'. These properties are valid:
   object { amd?, bail?, cache?, context?, dependencies?, devServer?, devtool?, entry?, externals?, infrastructureLogging?, loader?, mode?, module?, name?, node?, optimization?, output?, parallelism?, performance?, plugins?, profile?, recordsInputPath?, recordsOutputPath?, recordsPath?, resolve?, resolveLoader?, serve?, stats?, target?, watch?, watchOptions? }

 Command failed with exit code 1: webpack-cli --config /Users/gozala/Projects/js-ipfs/node_modules/aegir/src/config/webpack.config.js --progress 

There might be other / better ways to go about it with aegir, but so far I'm struggling to see those.

@Gozala
Copy link
Contributor Author

Gozala commented May 5, 2020

I would like to suggest adding --target webworker to aegir build (similar to aegir test --target webworker) that could produce build for webworker` target. Although that on it's own is probably not going to be enough. As we do need separate dist that spits out two files one for loading in the main thread and the other in the worker thread.

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 a pull request may close this issue.

1 participant