-
-
Notifications
You must be signed in to change notification settings - Fork 293
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
Incompatible with hard-source-webpack-plugin #148
Comments
@ctrlplusb hmm, if |
One thought I have for a solution for this is to search for the runtime module during emit. compiler.plugin('emit', function (compilation, callback) {
var runtimeAdded;
function walk(compilation) {
compilation.modules.forEach(function(module) {
if (module.resource === runtimePath) {
runtimeAdded = true;
}
});
compilation.children.forEach(walk);
}
walk(compilation);
if (!runtimeAdded && !_this2.__tests.ignoreRuntime) {
|
@mzgoddard okay, sounds like a way to go. Do you think this is the only/best way to handle that? Will it affect normal compilations (without |
I thought about that a bunch yesterday. I have one small improvement. Iterate over the chunks and modules in them. function walk(compilation) {
compilation.chunks.forEach(function(chunk) {
chunk.modules.forEach(function(module) {
if (module.resource === runtimePath) {
offlinePlugin.flags.runtimeAdded = true;
}
});
});
compilation.children.forEach(walk);
}
walk(compilation); It works with I wrote up a repo to test these ideas along with a little write up on the issue. https://github.com/mzgoddard/webpack-hard-source-offline-compat-demo I'm also wondering about false negatives. DllReferencePlugin comes to mind. You could build a Dll with DllPlugin and OfflinePlugin. Then build with Reference and Offline. That setup should work. The current test and the proposed one would both fail here though. Pulling out the info to see if the runtime is somewhere in that second build may be tricky. |
I noticed this only happens when using webpack 2.1.0-beta.27 or 2.1.0-beta.28 but NOT 2.1.0-beta.25 Not sure if the issue reported by @ctrlplusb is really related to offline-plugin or hard-source-webpack-plugin Just my 2 cents. |
@kikoanis Are you experiencing this bug with webpack@2.1.0-beta.28 (or webpack@2.1.0-beta.27)?
I think we have identified the specific issue between You might have experienced the bug in hard-source that existed for a few hours yesterday when |
I'm not sure I follow now. Where is the bug now, in webpack? If it isn't in webpack when why it exists in some versions and doesn't in others? |
@mzgoddard, in both but not in webpack@2.1.0-beta.25. I think it's nothing to do with both plugins and more to do with webpack beta releases. I need to do more debugging though to be sure. |
@kikoanis I'm not sure how |
Well I tested it on a private repo and I can assure you it is passing (both of the plugins are the latest version). Even after installing 27/28 and then back to reinstalling 25. So nothing to do with something left behind. May be different configuration! I do not know. Will have to check it against your repo when I have sometime and let you know. |
I think the simplest and the fastest they to kind of fix it is to simply not do the check when
I'm not sure if I want to remove current test completely. After all, that test is legit unless some other plugins modify build process. i.e. I might expect it to be broken with @mzgoddard Maybe I can use your test when current test fails, i.e. fallback to yours. Also false positives/negatives worry me here. Maybe it makes to just turn this check into a warning? |
@mzgoddard what do you about this: #152? Might be incompatible with another plugin? |
@NekR the issue I am facing with Phenomic is related to this thread. To reproduce
Running 2 builds to generate the cache, then trigger the issue. |
@MoOx Yeah, I see, it has to be fixed. I can do that tomorrow, I think. |
... and use compilation.fileDependencies to look for runtime-template.js file usage Fixes #148
Okay, I made a fix for this: #172 |
I should be able to review today.
…On Tue, Jan 31, 2017 at 10:17 AM, Arthur Stolyar ***@***.***> wrote:
Okay, I made a fix for this: #172
<#172>
@mzgoddard <https://github.com/mzgoddard> would you mind to review it?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#148 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAy3EpccPg2mor4-HFop1FNQ_QILnMElks5rX1B_gaJpZM4LIIaZ>
.
|
@mzgoddard thanks! There is just a couple lines of changes and I already tests with |
This is fixed, I just published 4.6.0. Thanks for helping everyone! |
@MoOx btw, does it works now for you? |
I have logged this on
hard-source-webpack-plugin
here, but I am going to log an issue here too.When this plugin is used alongside
hard-source-webpack-plugin
I get the following error on the second build of the project:The second attempt I assume tries to use the cache generated by
hard-source-webpack-plugin
.The text was updated successfully, but these errors were encountered: