rguerreiro / device

Device type detection library based on the useragent string. Refactored from my express-device repo.
MIT License
79 stars 27 forks source link

Error: Cannot find module "../package" #24

Closed maxletourneur closed 6 years ago

maxletourneur commented 6 years ago

Great work!

Using webpack 2, I'm running into this error where the relative reference to package module in ./node_modules/device/lib/device.js breaks.

Seems normal as it looks for "package" in ./node_modules/device folder while it should be looking for it in ./node_modules.

maxletourneur commented 6 years ago

Fixed it by adding .json in webpack config resolve rule: resolve: { extensions: ['.ts', '.tsx', '.js', '.jsx', '.json'] },

luchillo17 commented 6 years ago

I can't change the extensions, didn't got permission to eject the app, can't we just change the require from package to package.json?