nolanlawson / optimize-js

Optimize a JS file for faster parsing (UNMAINTAINED)
https://nolanlawson.github.io/optimize-js
Apache License 2.0
3.75k stars 104 forks source link

Add an option to read sourcemap #5

Open ooflorent opened 8 years ago

ooflorent commented 8 years ago

Adding an option to access the source map would ease the integration with build tools. e.g.:

const {code, map} = optimizeJs(input, {
  sourceMap: true,
  extractSourceMap: true,
})
nolanlawson commented 8 years ago

My bad, yes, this should be supported!

sanex3339 commented 8 years ago

any news?

matteoantoci commented 7 years ago

+1, this is really important for vigneshshanmugam/optimize-js-plugin too. Thanks!

sanex3339 commented 7 years ago

bump

nicoecheza commented 7 years ago

bump again

ansballard commented 7 years ago

Looks like this issue ties directly to https://github.com/nolanlawson/optimize-js/pull/25, which seems to be stuck on implementation decisions.

Rough tl;dr: optimize-js uses https://www.npmjs.com/package/magic-string under the hood, but doesn't pass any options and only returns the parsed code. Looks like the current ideas are to return either a MagicString instance or a Map object, but that would definitely be a breaking change.

jareguo commented 7 years ago

bump

pavelloz commented 6 years ago

Nothing?

ansballard commented 6 years ago

https://github.com/nolanlawson/optimize-js/pull/25#issuecomment-303597798

Doesn't look like it's gonna happen.