My ambition is to include a folder, located in node_modules/. Using Node.js I can do:
var example = require('example');
But in my Google Chrome extension it doesn't work, it throws the error:
Require is not defined.
Chrome extensions support ES6 modules in content scripts. You can use the import statement to include modules:
import example from './path-to-node-modules/example';
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With