-
-
Notifications
You must be signed in to change notification settings - Fork 8.7k
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
JENKINS-62473 Add source maps #4753
Conversation
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.
LGTM, thanks! I'd guess we will need to test it with the CSS update effort
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.
JavaScript seems to be working, but the less => css sourcemaps don't seem to be working, would you be able to take a look please?
I will check it. It produces separate files in production, but should be inlined when developing. Perhaps there is no change that needs to be mapped? Right now it should just give line numbers in dev. |
possibly I didn't check the production mode but its definitely giving the css files rather than the less files in chrome developer tools and if I check the css files I can't see any mention of a mapping file or inline mapping |
I think I'm testing this all wrong. Maybe I'm missing something here. I'm not able to have this working. |
I will check this again and fix it. |
Source maps are generated in the .js-files för development, but seem to use absolute file paths: eval("// extracted by mini-css-extract-plugin//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9zcmMvbWFpbi9qcy9hZGQtaXRlbS5sZXNzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vc3JjL21haW4vanMvYWRkLWl0ZW0ubGVzcz82YmNjIl0sInNvdXJjZXNDb250ZW50IjpbIi8vIGV4dHJhY3RlZCBieSBtaW5pLWNzcy1leHRyYWN0LXBsdWdpbiJdLCJtYXBwaW5ncyI6IkFBQUEiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./src/main/js/add-item.less\n");
/***/ }),
/***/ 3:
/*!*******************************************************************!*\
!*** multi ./src/main/js/add-item.js ./src/main/js/add-item.less ***!
\*******************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
__webpack_require__(/*! C:\Dev\Git\jenkins\war\src\main\js\add-item.js */"./src/main/js/add-item.js");
module.exports = __webpack_require__(/*! C:\Dev\Git\jenkins\war\src\main\js\add-item.less */"./src/main/js/add-item.less"); This could be problematic when running in Docker. |
Weird I tested this again in development and production mode and I still don't see source maps for less =/ |
Me neither |
@95jonpet would you be able to see if it works for you in a local setup please? Here's the documentation for frontend work: |
Sure thing. |
@timja, thank you for linking relevant documentation. I have changed implementation during development to Clicking on |
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.
Thanks, I've tested in both production and development mode and it's working now
This PR is now ready for merge, and will merged after ~24 hours if there's no negative feedback |
Unmarking as ready-for-merge I've been running this locally and after making a change it seems to crash my Mac, I took a photo of the log from my phone as the computer was completely unresponsive: I was editing less files in development mode at the time, Would be good to know if this is affecting anyone else before we merge this |
I'm seeing similar-ish behaviour in the logs without this change but while my computer gets slower it doesn't fully lock up:
|
Seems to be fixed by either adding cc @halkeye if you've seen something similar before |
See JENKINS-62473.
Adds source maps for built JS and CSS using reasonable settings from the available options. Production source maps are generated optimized for quality, whereas development source maps are of lower quality and faster to produce.
The solution uses the
mode
value passed to webpack frompackage.json
:Proposed changelog entries
Proposed upgrade guidelines
N/A
Submitter checklist
Proposed changelog entries
section only if there are breaking changes or other changes which may require extra steps from users during the upgradeDesired reviewers
@timja
Maintainer checklist
Before the changes are marked as
ready-for-merge
:Proposed changelog entries
are correctupgrade-guide-needed
label is set and there is aProposed upgrade guidelines
section in the PR title. (example)lts-candidate
to be considered (see query).