I\'m having trouble accessing a webpack bundled library from the browser.
Example: I have a class Foo
// foo.js
\"use strict\";
export de
To make this code re-usable, you need to tell webpack you are authoring a Library.
From the webpack documentation:
To make your library available for reuse, add library property in webpack configuration.
To create your library, make the following change:
module.exports = {
entry: './src.js',
output: {
path: '.',
filename: 'bundle.js',
library: 'fooLibrary', //add this line to enable re-use
},
...
In order to use the library, you can then reference it in your other scripts: