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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

--no-source-maps doesn't work if source maps are cached #2692

Closed
DeMoorJasper opened this issue Feb 27, 2019 · 6 comments
Closed

--no-source-maps doesn't work if source maps are cached #2692

DeMoorJasper opened this issue Feb 27, 2019 · 6 comments

Comments

@DeMoorJasper
Copy link
Member

DeMoorJasper commented Feb 27, 2019

馃悰 bug report

Continuation of #2079

I am still seeing this issue on parcel-bundler 1.11.0.

  1. If I build with source maps, then rm -r dist/ and build with --no-source-maps, then I still get source maps in dist/
  2. If I then rm -r .cache/ dist/ to remove both the cache and dist and build again with --no-source-maps, then I get it without source maps
./node_modules/.bin/parcel --version
1.11.0

by @mrcoles

馃帥 Configuration (.babelrc, package.json, cli command)

parcel build index.js --no-source-maps

馃 Expected Behavior

should not package sourcemaps

馃槸 Current Behavior

Packages cached sourcemaps

馃拋 Possible Solution

check if sourcemaps should be made in packaging

馃實 Your Environment

Software Version(s)
Parcel 1.11
Node 10
npm/Yarn latest
Operating System OS X
@mischnic
Copy link
Member

@DeMoorJasper This is the very last issue I have with the CSS source maps PR, I also proposed two possible solutions, but I'm not sure which is better: #2489 (comment)

@DeMoorJasper
Copy link
Member Author

DeMoorJasper commented Feb 27, 2019

@mischnic not sure if always creating a sourcemaps on asset lvl is a good idea, it will impact performance on builds and it鈥檚 unlikely someone will change between no sourcemaps and sourcemaps a lot.
Only outputting sourcemaps bundles if sourcemaps are enable seems like the best idea, but the flag shouldn鈥檛 invalidate cache afaik as packaging isn鈥檛 cached

Sent with GitHawk

@mischnic
Copy link
Member

not sure if always creating a sourcemaps on asset lvl is a good idea, it will impact performance on builds and it鈥檚 unlikely someone will change between no sourcemaps and sourcemaps a lot.

This would mean: invalidate the cache based on the flag because assets are cached

but the flag shouldn鈥檛 invalidate cache afaik as packaging isn鈥檛 cached

A contradiction?

@DeMoorJasper
Copy link
Member Author

DeMoorJasper commented Feb 27, 2019

@mischnic yeah just realised that switching from no sourcemaps to sourcemaps would have unexpected results of sourcemaps flag is not part of cache. Thinking about that it would probably need to invalidate I guess, depends on how much impact sourcemaps would have on performance. If it has little to no impact it might be worth it to always generate sourcemaps and not package them based on flag

Sent with GitHawk

@mischnic
Copy link
Member

depends on how much impact sourcemaps would have on performance.

w/ sourcemaps w/o sourcemaps
react boilerplate 6.57s 5.64s
reproduction from #2685 127.62s 72.00s

Opting for invalidation (to keep these values).

@nVitius
Copy link

nVitius commented Jul 2, 2019

@mischnic @devongovett Can you guys expand on why this issue was closed? It doesn't make sense to have an option to not build source maps and then proceed to include them anyways. In my case, I want source maps to be generated for development. But I don't want them to be generated for my build that goes out to production as they essentially double my app size. I don't see why I should have to clear the cache every time I want to make my production build. Am I just thinking about this the wrong way?

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

No branches or pull requests

3 participants