prepack-webpack-plugin icon indicating copy to clipboard operation
prepack-webpack-plugin copied to clipboard

Utilise prepackFromAst

Open gajus opened this issue 8 years ago • 6 comments

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

gajus avatar May 03 '17 19:05 gajus

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 avatar May 03 '17 19:05 gajus

@montogeek Do you happen to have experience with this?

gajus avatar May 03 '17 19:05 gajus

@gajus No, no really

montogeek avatar May 04 '17 10:05 montogeek

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?

jsonnull avatar May 11 '17 15:05 jsonnull

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

Bnaya avatar Jun 04 '17 12:06 Bnaya

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.

gajus avatar Jun 04 '17 20:06 gajus