As I delve into a new project, the idea of numerous npm packages looms ahead. However, my approach is shifting towards eliminating pre-compiled files. Within the src directories of these packages, only d.ts, ts, js, and mjs files will reside - a radical departure from tradition motivated by both laziness and a belief that the time has come to halt pre-compilation entirely.
The question arises: how many variations must be tailored? ESModules, AMD, CommonJs, SystemJS? My simple inclination suggests leaving it untouched (import x from 'x', export foo = 123), entrusting developers with the necessary tools (Babel, Typescript) to handle integration efficiently, wouldn't you agree?
The second quandary stands at the brink: to what extent should these packages be compiled? Should we aim for ES3 or push forward to ES6 compatibility, catering solely to users on modern browsers? Is implementing differential loading the key solution here, despite its common association with HTML files rather than selectively used developer packages?
To simplify, do we truly need to invest extensive effort in this regard? Where does the lowest common denominator lie currently? While concrete statistical data eludes me, it appears that most projects employ some form of compiler/preprocessor like Babel or PostCss. What are your thoughts on this matter?