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

How to renormalize sources in sourcemaps when building #822

Open

Description

@CxRes

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)??

Activity

  1. guybedford commented on Jul 22, 2017

    @guybedford
    Member

    Maybe try building the application within the baseURL itself?

  2. CxRes commented on Jul 22, 2017

    @CxRes
    ContributorAuthor

    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 join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions