Without a libraryTarget the webpack bundle is simply a self executing
function and so when imported, the function gets run, but never returns
any code for the parent module to use, making the module useless.
The difference between the targets commonjs and commonjs2 are small, but the commonjs webpack compiler strips away __esModule which breaks ES6 imports of modules created with cf-package.
Without a
libraryTarget
the webpack bundle is simply a self executing function and so when imported, the function gets run, but never returns any code for the parent module to use, making the module useless.The difference between the targets
commonjs
andcommonjs2
are small, but thecommonjs
webpack compiler strips away__esModule
which breaks ES6 imports of modules created with cf-package.