What is the best way to convert a library written in TypeScript to ES5?
While JSPM documentation focuses on web apps (such as with jspm bundle-sfx
), the information I've found on Google seems more suited for a web app workflow rather than a library workflow.
In my projects, I have:
A dependency on
react
,flux
, andjquery
, all installed throughjspm
and configured inconfig.js
The source
.tsx/.ts
files are located in asrc/
directory, along with their transpiled.js
filesSuccessfully created a bundle using
jspm bundle
, though it requires users to use SystemJS
I'm looking to bundle the entire content under src/
into a single file without including libraries like react
or jquery
. How can this be achieved?
Initially, I attempted
jspm bundle src/<MY_MAIN.js> - react - jquery <OUT.js>
which worked but still necessitated a module loader for accessing exported symbols in MY_MAIN.js
. Ideally, I'd like to offer users the option to manually import my library using <script>
tags. However, self-executed bundles don't seem to function properly as no symbol is globally accessible when loaded via the <script>
tag, and excluding the framework code is proving tricky.