question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

--outfile option incompatible with current method for generating external sourcemap

See original GitHub issue

The README states that if the user would like to have their sourcemap pushed to an external file, as opposed to inlined in the bundle itself, they should use exorcist and pipe browserify’s output through exorcist before writing the output file with >.

If the user makes use of the the --outfile (which doesn’t currently offer any real benefit over >, but would if #995 were to be accepted :cough:), then this method of generating an external sourcemap isn’t an option, as browserify no longer pipes to process.stdout and exorcist has no input on which to act.

It would seem that allowing browserify to directly create an external sourcemap file by either providing the --debug option with a filename as a value, or by adding a --debug-file option would be useful.

I don’t know that this is directly resolvable within browserify, as sourcemap generation appears to be delegated to browser-pack, so I’m hoping that @substack or someone else equally familiar with both packages could provide some input as to whether this is possible, or if it’s been discussed and rejected as a feature in the past.

Thanks.

Issue Analytics

  • State:open
  • Created 9 years ago
  • Reactions:1
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
ghostcommented, Nov 24, 2014

Then don’t use -o? I don’t see what’s so hard about:

$ browserify main.js --debug | exorcist bundle.js.map > bundle.js

especially when the docs mention exorcist already and provide a handy example.

0reactions
alundiakcommented, Dec 27, 2017

I can’t use --outfile when path to file contains not existed yet folder. Any ideas how can I configure it?

 "build-js": "browserify src/main.js --debug -o dist/bundle.js",

dist is not existed.

My workaround:

"scripts": {
  "build-css": "lessc src/my.less dist/my.css",
  "build-js": "browserify src/main.js -o dist/bundle.js",
  "prebuild": "mkdir dist",
  "build": "npm run build-css && npm run build-js"
},

And when I run npm run build, then prebuild is executed before and all is goo with browserify, But maybe there is a chance to configure browserify to create dist folder?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unsupported source map comment for compiled TypeScript
The warning happens because source maps are enabled but esbuild doesn't have enough information to respect the source map comment. I can turn ......
Read more >
External source maps for minified, transpiled ES6 code with ...
If I change webpack. config. js so that it says devtool: "#source-map" , the source map is created as a separate file (using...
Read more >
TSConfig Reference - Docs on every TSConfig option
js output file. The .js files will in turn contain a sourcemap comment to indicate where the files are to external tools, for...
Read more >
API - esbuild
The build API can take the following options: Simple options: Alias; Bundle; Define; Entry points; External; Format; Inject; Loader; Minify; Outdir; Outfile ......
Read more >
Source Maps - Rollbar Docs
Here is a simple example of using uglify to generate a source map with sources included: uglifyjs script.js --source-map "includeSources=true" --output script.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found