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

Plugin breaks sourcemaps on Google Chrome #3

Closed
sprguillen opened this issue Nov 13, 2018 · 24 comments
Closed

Plugin breaks sourcemaps on Google Chrome #3

sprguillen opened this issue Nov 13, 2018 · 24 comments

Comments

@sprguillen
Copy link

As stated in the README: This plugin runs babel and rollup only once per asset, at the end of the compilation process.

Works like a charm as it runs my VueJS app on IE but the problem is that it breaks sourcemaps on Chrome: here's a more elaborate article on stackoverflow.

Maybe you can address this if you have plans to update the module. Thanks!

@sheerun
Copy link
Owner

sheerun commented Nov 13, 2018

Maybe you want to prepare and test the fix? I forked from other project where PR fixing this is available: https://github.com/simlrh/babel-webpack-plugin/pull/2/files

@sprguillen
Copy link
Author

You mean I'll use babel-webpack-plugin in-conjunction with targets-webpack-plugin?

@sheerun
Copy link
Owner

sheerun commented Nov 13, 2018

I mean to submit PR to this repository fixing this issue. You can find fix for repository I forked from in the link I've sent before

@sheerun
Copy link
Owner

sheerun commented Nov 13, 2018

The issue is not with PR but with testing if it really works and that could be your part

@sprguillen
Copy link
Author

I made some revisions to no avail. The PR isn't as simple as we thought it might because it requires us to use SourceMapSource instead of OriginalSource which need us to have an inputSourceMap defined. Adding the line where asset.sourceAndMap will be defined would lead to a Javascript heap out of memory error. I don't know if I'm doing it right since I did not author this module..

@sprguillen
Copy link
Author

Reference to the changes I've applied are on this link.

@sheerun
Copy link
Owner

sheerun commented Nov 14, 2018

@sprguillen I've published 2.0.0-alpha.0 which should have sourcemaps support. Do you want to test it?

@sprguillen
Copy link
Author

Great! Thanks, I'll gladly test it for you.

@sprguillen
Copy link
Author

2018-11-15_1314

I got this error, it's quite similar after I tried to applied the fix you mentioned..

@sheerun
Copy link
Owner

sheerun commented Nov 15, 2018 via email

@sprguillen
Copy link
Author

Sorry my fault on webpack-source. I wasnt using 2.0 alpha but the Javascript heap out of memory is now happening on 2.0.0 alpha...

@sheerun
Copy link
Owner

sheerun commented Nov 15, 2018

Did you try 2.0.0-alpha.1 ?

@sprguillen
Copy link
Author

Yes, that's the one causing the error..

@sheerun
Copy link
Owner

sheerun commented Nov 15, 2018

I think it's simply because sourcemaps are generated and you don't have enough memory. You can pass { sourceMaps: false } to disable generating sourcemaps but in general you should disable it for development

@sheerun
Copy link
Owner

sheerun commented Nov 15, 2018

Does it fail on CI as well?

@sprguillen
Copy link
Author

I haven't tried on CI. We actually need sourcemaps more on development rather than in production. :) I think bundling for legacy browsers + sourcemaps overloads NodeJS.

@sheerun
Copy link
Owner

sheerun commented Nov 15, 2018

FYI it works for me on my CI, and on my OSX but I have 16GB ram

@sprguillen
Copy link
Author

What's your current setup? I'm currently using Windows, Node 10.9.0..

I actually have 16gb ram as well.. CI means continuous integration right? I'm currently not using any CI tools. Just yarn or npm.

@sheerun
Copy link
Owner

sheerun commented Nov 15, 2018 via email

@sprguillen
Copy link
Author

I think it does make the difference, I don't use any CI tool and maybe that's why I have those heap issues. This plugin when sourceMap enabled may only be compatible with having been deployed by Travis.. Have you tried it without using Travis? Just running the node server using yarn or npm? Does it work?

@sheerun
Copy link
Owner

sheerun commented Nov 15, 2018 via email

@sprguillen
Copy link
Author

We made some changes on the webpack configuration and tested on 2.0.0-alpha.1, it successfully worked! Good job! Closing this issue now..

@sheerun
Copy link
Owner

sheerun commented Nov 20, 2018

Glad to hear :) Mind to tell what changes?

@sprguillen
Copy link
Author

We used the webpack-bundle-analyzer and restructured how plugins are being loaded by webpack, that may have reduced the amount of memory webpack is consuming when compiling code.

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

No branches or pull requests

2 participants