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
[gatsby] gatsby develop
produces minified source code
#19128
Comments
2.13.x is the last good minor version. Seeing if I can narrow it down to a specific change. |
2.13.30 is the first bad version, 2.13.29 is the last version that produces un-minified source code with Repro with 2 copies of Screenshots of what I mean: |
This bumped https://github.com/gatsbyjs/gatsby/compare/babel-preset-gatsby@0.2.6...babel-preset-gatsby@0.2.7 This new code introduces gatsby/packages/babel-preset-gatsby/src/index.js Lines 32 to 33 in 118eb30
|
Gatsby does use Just to verify before I get to check this tomorrow - is code minified/uglified (so variable names are renamed to 1 letter variables) or compacted (new lines are removed)? I see there is |
Quick verification could also help - going to For proper fix we would need to conditionally set this only for production builds |
The code does not appear to actually be minified, some of my longer variable names remain, but just are on one line. In gatsby 2.17.6 changing to node_modules/gatsby/dist/utils/webpack-utils.js {
let js = (_ref = {}) => {
let {
modulesThatUseGatsby = []
} = _ref,
options = (0, _objectWithoutPropertiesLoose2.default)(_ref, ["modulesThatUseGatsby"]);
return {
test: /\.(js|mjs|jsx)$/,
include: modulePath => {
// when it's not coming from node_modules we treat it as a source file.
if (!vendorRegex.test(modulePath)) {
return true;
} // If the module uses Gatsby as a dependency
// we want to treat it as src so we can extract queries
return modulesThatUseGatsby.some(module => modulePath.includes(module.path));
},
type: `javascript/auto`,
use: [loaders.js(Object.assign({}, options, {
configFile: true,
compact: true
}))]
};
};
rules.js = js;
} |
Yep, fixes for me as well! |
gatsby develop
produces minified source codegatsby develop
produces minified source code
We'd appreciate a PR fixing that! :) |
The workaround discussed above might affect the production builds as well. |
@pieh where is exactly the cache I need to delete? I don't see any .cache right under node_modules I need the opposite case, to minify the development build |
Description
The develop mode is producing minified source code, which means I can't add breakpoints
Steps to reproduce
Expected result
Code viewed in developer tools should allow breakpoints to be set on most lines.
Actual result
Only a small percentage of lines are selectable.
Environment
The text was updated successfully, but these errors were encountered: