-
-
Notifications
You must be signed in to change notification settings - Fork 372
feature: Enable source maps in production #140
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
Conversation
lukeed
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lol, easy enough! Embarrassed I didn't notice this was missing
|
That was my third try! |
developit
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Who would have thought
|
Build seems to be failing due to the tests now seeing |
@developit We need to fix the tests too, so it looks for the main styles.css instead of .map file right? |
+ tap-diff for pretty output
tests/build.snapshot.js
Outdated
|
|
||
| if (keys.length === 1 && keys[0] === 'size' && typeof keys[0] === 'number') { | ||
| return { size: Math.round(obj.size / 10) * 10 }; | ||
| if (keys.length === 1 && keys[0] === 'size' && typeof obj.size === 'number') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Turns out typeof key === 'number' is never true... wonder why...
Anyway sizes are now compared correctly (rounded to nearest 50 bytes for comparision) and without it would never know that push-manifest.json included source maps. 🙈
More significant changes added
|
Seems like snapshots have different sizes on CI because of absolute paths inside maps. Gonna investigate. |
|
I saw that. Would it make sense to just check |
|
I was thinking about checking it like this: expected - delta =< actual <= expected + delta. Coz too small could mean no output produced |
|
Yeah, or within 5% of expected. Either way would work imo. 👍 |
developit
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
new diff sizing looks good.
|
|
||
| for (let filename in compilation.assets) { | ||
| if (/route-/.test(filename)) { | ||
| if (/route-/.test(filename) && !/\.map$/.test(filename)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ooh good catch.
|
I wonder if there's a way to get webpack to avoid the absolute paths there? Seems like they could be normalized to be relative to |
|
@developit seems like module aliases & asnyc-component-loader don't play nicely. |
Closes #103