-
Notifications
You must be signed in to change notification settings - Fork 77
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
How to use protocol inside webpack? #377
Comments
The copy-webpack-plugin may be help here to copy the protocol source to your build directory. I used that here as an example if that may be useful https://github.com/mozmeao/performance-dashboard/blob/master/webpack.config.js |
Hmm, that's pretty non-ideal. It would be much better if I could simply It's been a while since I've used a library that only worked with access to |
Yeah, we only have a few pieces of JS currently to be honest, so i’m not sure how much you would really benefit from tree shaking here. We do have transpiling on our roadmap, but it’s not currently a top priority. Either way, you can still use ES5/a global with web-pack for the time being. |
@craigcook now that bedrock is also using webpack, I think it might be a good idea to enable our JS components to be imported. We could still keep the global variable I think for backward compatibility. |
This can be bundled in with #255 |
I'm trying to use protocol inside of webpack (with
HtmlWebpackPlugin
), and I've been banging my head against it for hours without much success.All of the included JavaScript files set things directly on
window
, e.g.window.Mzp.Navigation = Navigation
, instead of usingexport
. Am I missing something terribly obvious?Thanks!
The text was updated successfully, but these errors were encountered: