Closed lydell closed 6 years ago
Can confirm. Having this issue in 2.10.2 as well. Reverting back to 2.9.1 seems to work just fine.
Relevant brunch-config.cofee snippet:
plugins:
coffeescript:
bare: true
sass:
# use libsass
mode: 'native'
# Add optional includes
options:
includePaths: [
'node_modules/bourbon/core'
, 'node_modules/bourbon-neat/core'
, 'node_modules/normalize.css'
, 'node_modules/font-awesome/scss'
]
# To enable embedded source maps, pass the option `sourceMapEmbed`.
# This is only supported in _native_ mode; Ruby Sass isn't supported.
sourceMapEmbed: true
# Set the precision for arithmetic operations.
precision: 10
allowCache: false
postcss:
map: true
processors:
require('autoprefixer')(['defaults', 'last 3 versions', '> 1%'])
Relevant package.json bits:
{
"scripts": {
"start": "brunch watch --server --port 3333",
"build": "brunch build --production"
},
"dependencies": {
"fastclick": "^1.0.6",
"jquery": "^3.1.1",
"normalize.css": "^5.0.0"
},
"devDependencies": {
"auto-reload-brunch": "^2.0.5",
"autoprefixer": "^6.6.1",
"bourbon": "^=5.0.0-beta.7",
"bourbon-neat": "^=2.0.0-beta.2",
"brunch": "2.9.1",
"brunch-static": "^1.2.1",
"clean-css-brunch": "^2.0.0",
"coffee-script-brunch": "^2.1.0",
"font-awesome": "^=4.7.0",
"html-brunch-static": "^1.3.1",
"javascript-brunch": "^2.0.0",
"postcss-brunch": "0.5.0",
"sass-brunch": "^=2.9.0",
"uglify-js-brunch": "^2.0.0"
},
"license": "MIT"
}
edit/update: 2.9.1 seems to work, 2.10, 2.10.1 and 2.10.2 don't properly generate CSS source maps. Or rather, the source map only tracks the root file (i.e. css/all.scss
), and not css/site/_pages.scss
, for example.
Hi, @kgcreative, could you ensure me that https://github.com/lydell/brunch-sources-content-bug reproduces your bug as well as it does for @lydell.
@denysdovhan - Yes, that branch reproduces the same behavior i experience on my build.
@shvaikalesh can you please confirm that https://github.com/babel/babel-brunch/issues/56 is related? If so, I will close it out.
Yep, it is.
Any fixes coming down the pipes for this? Is the temporary fix to use 2.9.1?
FYI, when I used 2.9.1 I ended up losing compile-time errors so... I'm sticking with 2.10.x
Does pull request #1756 help at all?
Something is still off.
2.10.10, dev build (brunch watch): sourcemap contains output from Babel (transpiled code), line numbers on errors are correct.
2.10.10, prod build (with sourcemap): sourcemap contains original code, but line numbers are from Babel output, so they don't match.
I hope someone can confirm. For me this only makes it worse, because with 2.10.10 at least on a dev build I got line numbers matching the (bad) sourcemap.
1756, prod build: same as 2.10.10 (original code, but bad line numbers).
I hope someone can confirm. For me this only makes it worse, because with 2.10.10 at least on a dev build I got line numbers matching the (bad) sourcemap.
I can confirm. I have installed the latest release from today 2.10.11
.
/cc @jkruse @shreeve @shvaikalesh
I've submitted a PR #1757 that I believe fixes it completely (tested with @jkruse's testing scenarios with source, line numbers and singular or multiple processing steps). I've only tested with my own setup (buble, uglify, postcss and clean-css).
Someone else with a different setup verifying this certainly won't harm.
Works with Babel too, thanks @friday
Confirmed that this issue is fixed with 2.10.12; <= 2.10.11 had trouble
I'm on Brunch 2.10.16 and the line numbers for sourcemaps are off for npm_modules JS included.
Description
Source maps don't always map back to the original sources.
Expected/Actual behavior
Example repo: https://github.com/lydell/brunch-sources-content-bug
public/concat.css.map is correct:
public/concat.js.map is correct:
public/require.js.map is wrong. It misses the "app/_hello.js" source, and the included source content is the contents of public/require.js, not of app/main.js.
public/sass.css.map is wrong. It misses the "app/_include.scss" source, and the included source content is the contents of public/sass.css, not of app/main.scss.
Environment
package.json
contentsbrunch config contents