Build ECMAScript modules (#1479)

* Separate type import statement from module import statement

* Remove extension from import statements

* Build ECMAScript modules

* Add `cross-env` devDependency

* Use `babel-plugin-import-rename` instead of custom plugin

* Improve `.babelrc` style and add comments

* Update README.md

* Change file extension to `.mjs`

Comply with Node.js spec. Use extensionless package:main.

* Enforce only ESM compatible imports

* Dedupe packages

* Add `unicodeMake.js` to overrides:excludedFiles

* Fix .eslintrc merge conflict

* Use rollup to bundle ES module

* Remove `eslint-plugin-import`

* Change build directory to `dist`

* Change build directory to `dist`

* Change build directory

* Move docs from README.md to browser.md

* Update update-sri.js

* Revert update-sri.js

* Revert update-sri.js

* Update .eslintrc

* Remove SSH key testing
This commit is contained in:
ylemkimon
2018-08-13 13:06:40 +09:00
committed by GitHub
parent 295d933845
commit fdb155aa97
13 changed files with 148 additions and 34 deletions

14
rollup.config.js Normal file
View File

@@ -0,0 +1,14 @@
import babel from 'rollup-plugin-babel';
process.env.BABEL_ENV = 'esm';
export default {
input: 'katex.js',
output: {
file: 'dist/katex.mjs',
format: 'es',
},
plugins: [
babel(),
],
};