You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@annotator.apache.org by ra...@apache.org on 2020/08/05 05:23:37 UTC
[incubator-annotator] 04/04: Use a unified output directory with
.js or .mjs extensions
This is an automated email from the ASF dual-hosted git repository.
randall pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-annotator.git
commit a2806d438d7c79d615badec1b531e896768adb65
Author: Randall Leeds <ra...@apache.org>
AuthorDate: Tue Aug 4 22:22:03 2020 -0700
Use a unified output directory with .js or .mjs extensions
---
.eslintignore | 1 -
.gitignore | 1 -
babel.config.js | 2 +-
package.json | 8 ++++----
packages/dom/package.json | 5 ++---
packages/selector/package.json | 5 ++---
6 files changed, 9 insertions(+), 13 deletions(-)
diff --git a/.eslintignore b/.eslintignore
index 61cf845..ba489a4 100644
--- a/.eslintignore
+++ b/.eslintignore
@@ -3,6 +3,5 @@
!/packages/*/src/types
**/*.d.ts
/coverage
-/packages/*/esm
/packages/*/lib
/web/dist
diff --git a/.gitignore b/.gitignore
index 856c6a8..807d102 100644
--- a/.gitignore
+++ b/.gitignore
@@ -6,6 +6,5 @@ node_modules
tsconfig.tsbuildinfo
/packages/*/LICENSE
/packages/*/NOTICE
-/packages/*/esm
/packages/*/lib
/web/dist
diff --git a/babel.config.js b/babel.config.js
index 265fdcc..1dddf6a 100644
--- a/babel.config.js
+++ b/babel.config.js
@@ -44,7 +44,7 @@ module.exports = (api) => {
};
const addImportExtensionOptions = {
- extension: DEV || TEST ? 'ts' : 'js',
+ extension: DEV || TEST ? 'ts' : CJS ? 'js' : 'mjs',
};
// Options for the module-resolver plugin.
diff --git a/package.json b/package.json
index 913aa56..d97f19c 100644
--- a/package.json
+++ b/package.json
@@ -16,12 +16,12 @@
},
"scripts": {
"build": "yarn run build:cjs && yarn run build:esm && yarn run build:misc && yarn run build:types",
- "build:babel": "lerna exec --parallel -- babel --extensions '.js,.ts' --root-mode upward",
- "build:cjs": "cross-env BABEL_ENV=cjs yarn build:babel -d lib src",
- "build:esm": "cross-env BABEL_ENV=esm yarn build:babel -d esm src",
+ "build:babel": "lerna exec --parallel -- babel -d lib -s inline -x .ts --root-mode upward src",
+ "build:cjs": "cross-env BABEL_ENV=cjs yarn build:babel",
+ "build:esm": "cross-env BABEL_ENV=esm yarn build:babel --out-file-extension .mjs",
"build:misc": "lerna exec -- cp ../../LICENSE ../../NOTICE .",
"build:types": "tsc --build",
- "clean": "tsc --build --clean && lerna exec -- rimraf LICENSE NOTICE esm lib",
+ "clean": "tsc --build --clean && lerna exec -- rimraf LICENSE NOTICE lib",
"lint": "tsc --build && eslint .",
"prepare": "yarn run build:types && lerna run prepare",
"prepublishOnly": "yarn run build",
diff --git a/packages/dom/package.json b/packages/dom/package.json
index 498460a..6181f69 100644
--- a/packages/dom/package.json
+++ b/packages/dom/package.json
@@ -9,13 +9,12 @@
},
"license": "Apache-2.0",
"author": "Apache Software Foundation",
- "type": "module",
"exports": {
- "import": "./esm/index.js",
+ "import": "./lib/index.mjs",
"require": "./lib/index.js"
},
"main": "./lib/index.js",
- "module": "./esm/index.js",
+ "module": "./lib/index.mjs",
"types": "./src/types.d.ts",
"dependencies": {
"@babel/runtime-corejs3": "^7.8.7",
diff --git a/packages/selector/package.json b/packages/selector/package.json
index 80902cd..809d949 100644
--- a/packages/selector/package.json
+++ b/packages/selector/package.json
@@ -9,13 +9,12 @@
},
"license": "Apache-2.0",
"author": "Apache Software Foundation",
- "type": "module",
"exports": {
- "import": "./esm/index.js",
+ "import": "./lib/index.mjs",
"require": "./lib/index.js"
},
"main": "./lib/index.js",
- "module": "./esm/index.js",
+ "module": "./lib/index.mjs",
"types": "./src/index.d.ts",
"dependencies": {
"@babel/runtime-corejs3": "^7.8.7",