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

Upgrade to webpack2 & FIX #20 #22

Merged

Conversation

ndelangen
Copy link
Contributor

Upgrade to webpack 2.1.x-beta.20,
FIX compatibility with webpack 2.x ( #20 )

Upgrade other dependencies to latest.

Let me know if you want me to change anything or PR to a different branch?
Full disclosure: this is my first contribution to a webpack plugin.

@BohdanTkachenko
Copy link
Owner

Thanks for your PR! I think that I need to make some separate branch and publish this as some beta version while webpack2 is in beta too.

@micaelmbagira
Copy link

👍 Looks good, when do you plan to merge/release @BohdanTkachenko ?

@BohdanTkachenko
Copy link
Owner

@micaelmbagira I'll take a closer look on this weekend - don't have much time during work week

@the-spyke
Copy link

Works for me. Thanks, @ndelangen.

@BohdanTkachenko
Copy link
Owner

Published 0.1.0-beta.1 to NPM
Git branch webpack2-beta

Will merge it to master once webpack2 will be stable

@BohdanTkachenko
Copy link
Owner

Webpack issue to track when webpack2 is released - webpack/webpack#1545

Also, will keep this PR open to be not forget about it

@micaelmbagira
Copy link

micaelmbagira commented Aug 11, 2016

Great, thanks! Still, I have this issue now Uncaught TypeError: Cannot read property 'call' of undefined... caused by modules[moduleId] undefined, coming from the manifest.js. Maybe it is related to #17 ?

@jameswyse
Copy link

Just upgraded to 0.1.0-beta.1 and I'm now getting the same error as @micaelmbagira above.

I have a hunch this is related to html-webpack-plugin which doesn't seem to be aware of the vendor chunk I specified with this plugin. I tried the chunksSortMode: 'dependency' option but it didn't seem to help.

I'm on a tight deadline at the moment so I've had to disable this plugin for now. Will investigate some more when I have time! 😄

@hekike
Copy link
Contributor

hekike commented Jan 20, 2017

Webpack 2.x final release is out in the meantime: https://medium.com/webpack/webpack-2-2-the-final-release-76c3d43bf144

Any plan to re-visit this issue?

@ndelangen
Copy link
Contributor Author

I resolved the conflicts and updated to the latest webpack version 2.2.0

@hekike
Copy link
Contributor

hekike commented Jan 20, 2017

@ndelangen hmm I tried it out with our app but I got this:

bootstrap 319608a…:52 Uncaught TypeError: Cannot read property 'call' of undefined
// Execute the module function
modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);

@ndelangen
Copy link
Contributor Author

ndelangen commented Jan 20, 2017

@hekike Looks like a module is missing, modules[moduleId] is returning undefined.

Try finding which module is missing, and trace for clues why it's missing, might be a loader that's mis-configured?

What exactly have you tried?

@hekike
Copy link
Contributor

hekike commented Jan 20, 2017

@ndelangen thanks, but it works without webpack-split-by-path (I use your branch).

@ndelangen
Copy link
Contributor Author

It worked before this: 0bac591 ?

@hekike
Copy link
Contributor

hekike commented Jan 20, 2017

@ndelangen no, same error message :/

@hekike
Copy link
Contributor

hekike commented Jan 27, 2017

Did someone else receive similar error message?

@hekike
Copy link
Contributor

hekike commented Jan 27, 2017

@ndelangen okay, I realized what's happening. It splits the bundle correctly, I've all of the chunks, in my output folder, but my index.html only contains the original one, and doesn't include the other chunks. I use HtmlWebpackPlugin to put <script> tags to my index.html.

Do you have an idea from this angle? Is it more like a webpack-split-by-path or a html-webpack-plugin issue?

Update:

I debugged the html-webpack-plugin and seems to be that the splitted chunks in the compiler.plugin("emit", function(compilation, callback) {...} has initial: false, value, and that's why they are skipped.

{
    id: 0,
    rendered: true,
    initial: false,
    entry: false,
    recorded: undefined,
    extraAsync: false,
    size: 7469113,
    names: [ 'vendors' ],
    files: [ 'script/vendors.js', 'script/vendors.js.map' ],
    hash: '4455dd89e114f652e0f9',
    parents: [ 2 ],
    origins: []
}

As I see isInitial() is determinated based on entrypoints: https://github.com/webpack/webpack/blob/028c51301733836abbedc88be7483af2623f5943/lib/Chunk.js#L79

Shouldn't we add chunk to the this.entrypoints ?

@hekike hekike mentioned this pull request Jan 29, 2017
@BohdanTkachenko BohdanTkachenko merged commit 0bac591 into BohdanTkachenko:master Jan 29, 2017
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.

6 participants