M
M
Maxim Petelin2018-09-11 08:41:59
JavaScript
Maxim Petelin, 2018-09-11 08:41:59

How to build a js library that can be connected via a script tag to HTML?

I made a library and published it to npm. The source code is written in ES6 and divided into modules.
Through npm install, everything works great if you collect via weback in a bundle, etc.
How to properly build cdn ready version of the library?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
N
netrox, 2018-09-11
@netrox

https://www.jsdelivr.com

K
Konstantin Kitmanov, 2018-09-11
@k12th

npm install rollup --save-dev.
boilerplate for libraries
Or webpack .

A
Alexander Taratin, 2018-09-11
@Taraflex

https://webpack.js.org/guides/author-libraries/
+
For es6 -> es5 distillation
https://github.com/TypeStrong/ts-loader but you can also use babel
+
For polyfills
https://github. com/SebastianS90/webpack-polyfill-i...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question