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

add ability to load dependent chunks for non-web targets #8575

Merged
merged 1 commit into from Dec 29, 2018

Conversation

sokra
Copy link
Member

@sokra sokra commented Dec 29, 2018

This allows to use splitChunks for initial chunks in i. e. node and webworker targets

fixes #8161

What kind of change does this PR introduce?
refactor, feature

Did you add tests for your changes?
yes

Does this PR introduce a breaking change?
yes, RuntimeGlobals.startup now works differently

What needs to be documented once your changes are merged?
nothing

This allows to use `splitChunks` for initial chunks in i. e. node and webworker targets
@webpack-bot
Copy link
Contributor

For maintainers only:

  • This need to be documented (issue in webpack/webpack.js.org will be filed when merged)

@webpack-bot
Copy link
Contributor

Thank you for your pull request! The most important CI builds succeeded, we’ll review the pull request soon.

@sokra sokra merged commit 6dd1c9d into next Dec 29, 2018
@sokra sokra deleted the feature/split-chunks-single-file branch December 29, 2018 17:10
@russell-dot-js
Copy link

Hi @sokra,

I'm really excited about this feature because it allows me to build quickly (only tree-shake node_modules once) while minimizing artifact size (I version functions in AWS lambda and have hundreds deployed).

However, while digging in and starting to use it today, I found one issue. It works great, however it does not work with entries that have relative path.

E.g. if my vendor chunk is in /vendor.js, but my code is in /path/to/some/entry.js, entry.js will try to require('./vendor.js') rather than keeping the context of its relative path.

I THINK the right thing to do is to extend the functionality you've provided here, to be aware of relative path to dependent chunks, rather than naively requiring them.

What are your thoughts? Will this be a pretty easy change? TBH I haven't contributed to Webpack yet and get a little lost in the code

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

Successfully merging this pull request may close these issues.

None yet

3 participants