Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Should we store original sources array somewhere? #3

Open
phated opened this issue Mar 22, 2017 · 7 comments
Open

Should we store original sources array somewhere? #3

phated opened this issue Mar 22, 2017 · 7 comments
Labels

Comments

@phated
Copy link
Contributor

phated commented Mar 22, 2017

I'm wondering if we should clone and store the original sources array on the file or sourceMap object so we can use it later in sourcemaps.write or gulp.dest when sourcesContent is missing and needs to be loaded.

If we don't stash the original sources array, we could just document that this needs to be used with caution if the end-user expects sourcesContent to be populated.

@phated
Copy link
Contributor Author

phated commented Mar 22, 2017

@nmccready thoughts?

@nmccready
Copy link

nmccready commented Mar 22, 2017

Stashing is fine with me as things are already being stashed into a file for the sourceMap context. However maybe it should be

file.sourceMapping = { // some domain relevant to this project to **not** pollute file in only our domain context
   sourceMap,
   contents,
  sources
}

@phated
Copy link
Contributor Author

phated commented Mar 22, 2017

I'm thinking file._sourceMapInternal to store our extra information.

@phated
Copy link
Contributor Author

phated commented Mar 22, 2017

I'm just not sure if it should be stashed at all. It seems like people are using this feature in conjunction with includeContents: false because they don't get proper sources mapping.

@nmccready
Copy link

I'm thinking file._sourceMapInternal to store our extra information.

Good w/ me.

@nmccready
Copy link

I'm just not sure if it should be stashed at all. It seems like people are using this feature in conjunction with includeContents: false because they don't get proper sources mapping.

Well you can at least push the sources we did find do the options.mapSources if it exists. That way the user can have access to fix /fill it out.

@phated
Copy link
Contributor Author

phated commented Mar 22, 2017

Well you can at least push the sources we did find do the options.mapSources if it exists. That way the user can have access to fix /fill it out.

This module is actually going to be replacing the mapSources option in sourcemaps.write because the module has become very bloated. It'll be exposed by the main module as sourcemaps.mapSources for users to put into their pipeline.

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

No branches or pull requests

2 participants