Skip to content
This repository has been archived by the owner on Oct 9, 2020. It is now read-only.

How to renormalize sources in sourcemaps when building #822

Open
CxRes opened this issue Jul 17, 2017 · 2 comments
Open

How to renormalize sources in sourcemaps when building #822

CxRes opened this issue Jul 17, 2017 · 2 comments

Comments

@CxRes
Copy link
Contributor

CxRes commented Jul 17, 2017

This is probably a support request but it may be a feature request

I have a program structure like this:

project
|-- package.json
|-- src
     |-- config.js
     |-- jspm_packages
     |-- bootstrap.js

I am doing a build like this:

builder.bundle('bootstrap.js', 'des/output.js', { minify:true, sourceMaps:true })

All the sources in the generated sourceMap start as ..\src\*. I would like to normalize these paths to get rid of ..\src portion, because des/ becomes its own independent package for distribution (I copy package.json and modify main; this is in a nwjs env). For example, Uglify offers the base option for sourceMaps. I cannot see an equivalent option here (I have tinkered with baseURL to no avail)??

@guybedford
Copy link
Member

Maybe try building the application within the baseURL itself?

@CxRes
Copy link
Contributor Author

CxRes commented Jul 22, 2017

The trouble with that is (it was the first idea I had as well) that I cannot replace bootstrap.js with itself. If I use another name, then I have to rewrite my index.html to modifying the script tag to point to this new name. Right now I can copy the index.html from src to des. If I rename and copy this file instead, the reference in the map file has a different name, which means I have to rewrite that then
Also, it just feels wrong to build files in the src folder...

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants