diff --git a/build/package.json b/build/package.json new file mode 100644 index 000000000..6a0d2ef2a --- /dev/null +++ b/build/package.json @@ -0,0 +1,3 @@ +{ + "type": "commonjs" +} \ No newline at end of file diff --git a/dist/package.json b/dist/package.json new file mode 100644 index 000000000..6a0d2ef2a --- /dev/null +++ b/dist/package.json @@ -0,0 +1,3 @@ +{ + "type": "commonjs" +} \ No newline at end of file diff --git a/package.json b/package.json index 7c2beebc5..bbd92f092 100644 --- a/package.json +++ b/package.json @@ -59,5 +59,17 @@ "ts-jest": "^27.0.6", "typescript": "^4.4.3", "uglify-js": "^3.10.0" + }, + "type": "module", + "exports": { + ".": { + "types": "./index.d.ts", + "require": "./dist/zrender.js", + "import": "./index.js" + }, + "./*.js": "./*.js", + "./*.ts": "./*.ts", + "./*.json": "./*.json", + "./*": "./*.js" } -} +} \ No newline at end of file diff --git a/src/.eslintrc.yaml b/src/.eslintrc.yaml index 8fb078f0f..752deedd0 100644 --- a/src/.eslintrc.yaml +++ b/src/.eslintrc.yaml @@ -21,7 +21,7 @@ rules: - "warn" - "error" no-constant-condition: 0 - comma-dangle: 2 + comma-dangle: 0 no-debugger: 2 no-dupe-keys: 2 no-empty-character-class: 2 diff --git a/test/package.json b/test/package.json new file mode 100644 index 000000000..6a0d2ef2a --- /dev/null +++ b/test/package.json @@ -0,0 +1,3 @@ +{ + "type": "commonjs" +} \ No newline at end of file