gajus / prepack-webpack-plugin

A webpack plugin for prepack.
Other
1.04k stars 46 forks source link

Utilise prepackFromAst #6

Open gajus opened 7 years ago

gajus commented 7 years ago

The prepack method does not allow to utilise source maps. Use prepackFromAst to sourcemap generation.

gajus commented 7 years ago

I haven't had time to take a proper look into this, but it appears that UglifyJs plugin is operating on the AST level.

https://github.com/webpack-contrib/uglifyjs-webpack-plugin/blob/master/src/index.js

gajus commented 7 years ago

@montogeek Do you happen to have experience with this?

montogeek commented 7 years ago

@gajus No, no really

jsonnull commented 7 years ago

I just took a look at the prepack source, and the prepackFromAst method currently ignores the AST and parses the code identically to the prepack method.

I'm thinking this means that sourcemaps just aren't possible with the current state of prepack. Can somebody confirm?

Bnaya commented 7 years ago

So if i understand correctly, source maps aren't working on that moment?

gajus commented 7 years ago

So if i understand correctly, source maps aren't working on that moment?

As far as I understand, source maps do not work at all with Prepack.