NathanaelA/nativescript-zxing

Webpack support

Closed this issue · 1 comments

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.

Thanks fixed in v1.5.1