NathanaelA / nativescript-zxing

ZXing for NativeScript
Other
15 stars 22 forks source link

Webpack support #6

Closed bnussey closed 7 years ago

bnussey commented 7 years ago

At present package.json has "main" : "zxing.js", which causes an issue with Webpack as per http://docs.nativescript.org/angular/tooling/bundling-with-webpack.html#recommendations-for-plugin-authors

Please see below

Referencing Platform-specific modules from "package.json"

This is the most common problem with third party plugins. Most plugins provide two platform-specific implementations stored in modules named like my-plugin.android.js and my-plugin.ios.js. The package.json file for the plugin looks like this:

{
    "main": "my-plugin.js"
}
Webpack will read the package.json file and try to find a my-plugin.js module and will fail. The correct way to reference a platform-specific module would be to remove the .js extension:

{
    "main": "my-plugin"
}
That will allow webpack to correctly reference my-plugin.android.js or my-plugin.ios.js.
NathanaelA commented 7 years ago

Thanks fixed in v1.5.1