Closed lukekarrys closed 10 years ago
To workarround this, I've change the order of the prepend. Now its: the application + external libraries. If you want, I can make a pull request of this.
There is a workaround using the browserify-shim transform. A bit verbose but working example:
package.json
...
"dependencies": {
"browserify-shim": "~3.3.1"
},
"browser": {
"charFunk": "./clientapp/libraries/charFunk-1.1.1.min.js"
},
"browserify-shim": {
"charFunk": "charFunk"
}
}
add the transform into the browserify config for moonboots and activate source maps:
...
browserify: {
debug: true,
transforms:["browserify-shim"]
},
...
Looks like a documentation update is what's needed, to point people to browserify-shim if they want to maintain line numbers, and a warning that libraries
will shift line numbers.
Readme updated.
Because
libraries
are concatenated and prepended to the js source, they make the line numbers of the bundle no longer mapped to the source maps.Thanks to @whobubble for bringing up this issue.