I have the following project structure:
-dist
└ a.js (this is a bundled file)
-src
└ b.js
File a.js
function foo (name) {
console.log(name);
}
module.exports = foo;
File b.js
const log = require('../dist/a.js');
log('stackoverflow');
I want bundle the b.js file but i don't want include in this bundle the a.js file. So, when b.js be bundled and the output is written in dist folder, the b.js (bundled file) still require the a.js
How can i do this with webpack? i think that i should use 'externals' option in webpack config, but i can't find an example for non node_modules libs.