1
votes

I would like to fork barcode-scanner plugin to do a custom camera overlay and use it in my app but I don't know how to do it properly.

Those are my steps...

1 - I downloaded the master branch of

https://github.com/phonegap/phonegap-plugin-barcodescanner

2 - I copied it ant pasted into plugins folder

3 - I added it to the project like this.

ionic Cordova plugin add 'plugins/custom-barcodescanner'

4 - I imported it into my app.module.ts

import { BarcodeScanner } from '../../plugins/custom-barcodescanner';

Result: Cannot find module.....custom-barcodescanner'

Thanks for any help.

1

1 Answers

1
votes

you should add the plugin to a different folder than the project is in and then add it as a local plugin. this can be done like so:

ionic cordova plugin add /path/to/pluginfolder

another approach would be to fork the plugin on github and add your changes to your github fork. then add this repository as plugin:

ionic cordova plugin add https://github.com/path/to/your/fork