This repository has been archived by the owner on Oct 10, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 269
Not working with webpack? #71
Comments
When you use webpack you don't have global variables. Webpack 1Use var objectFitImages = require('object-fit-images');
objectFitImages('img'); Webpack 2Use import objectFitImages from 'object-fit-images';
objectFitImages('img'); |
Ah, I see, thank you! |
@bfred-it the only way I have been able to get this to work as expected is to use
|
Thanks for the followup! It looks like webpack 2 picks up the ES module version even with |
🎉 If you use # run this to get the latest ofi version
npm update object-fit-images --save |
Closed
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
When trying to pack the module with webpack, I get the following output:
Meaning, webpack cuts off the global variable 'objectFitImages', thus I cannot get it to work.
The text was updated successfully, but these errors were encountered: