Are there any guides how to create a npm library o...
# javascript
j
Are there any guides how to create a npm library out of a generated xxx.bundle.js generated from the kotlin frontend plugin?
Or how you at least can use require to load the library inside the bundle?
Think I managed to solve it by using webpack.config.d
a
Do you want to bundle several modules together, but keep the NPM dependencies separate, so that you could publish the result as a single
.js
file to NPM?
j
Already bundled it together with the frontend plugin so that part was smooth
Just unsure on how to make the bundle opening up my library as a commonjs importable library in node
But just added:
Copy code
config.output.library = "MyLib"
config.output.libraryTarget = 'commonjs',
config.output.umdNamedDefine = true
to a file in webpack.config.d directory
and it added the export
a
👍