facebookarchive / prepack

A JavaScript bundle optimizer.
http://prepack.io
Other
14.22k stars 425 forks source link

Support for jquery #2627

Open akbarexclusive opened 5 years ago

akbarexclusive commented 5 years ago

ReferenceError: $ is not defined at script.js:84:1 (https://github.com/facebook/prepack/wiki/PP0023)

Yegorich555 commented 4 years ago

You should inject $ as global object into js files. Prepack doesn't now anything about such variables... Webpack contains webpack.ProvidePlugin for such cases or use const $ = require('jquery') . It's not prepack issue at all because prepack is NodeJs package and works under NodeJs. You should pay attention on this. It's not "browser-package" but NodeJS...