Skip to content

Commit

Permalink
feat: 🎸 add cjs file for es9 (#98)
Browse files Browse the repository at this point in the history
* feat: 🎸 add cjs file for es9
  • Loading branch information
mjancarik authored Aug 25, 2021
1 parent ec4d528 commit 6b0a4a1
Show file tree
Hide file tree
Showing 11 changed files with 36 additions and 18 deletions.
10 changes: 9 additions & 1 deletion createRollupConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,15 @@ function createRollupES9Config() {

config.output = [
{
file: `./lib/index.es9.mjs`,
dir: './lib',
entryFileNames: '[name].es9.cjs',
format: 'cjs',
exports: 'named',
plugins: [getBabelOutputPlugin(babelES9BaseConfig)],
},
{
dir: './lib',
entryFileNames: '[name].es9.mjs',
format: 'esm',
exports: 'named',
plugins: [getBabelOutputPlugin(babelES9BaseConfig)],
Expand Down
5 changes: 3 additions & 2 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
"import": "./lib/index.mjs",
"require": "./lib/index.cjs"
},
"./lib/index.es9.mjs": "./lib/index.es9.mjs"
"./lib/index.es9.mjs": "./lib/index.es9.mjs",
"./lib/index.es9.cjs": "./lib/index.es9.cjs"
},
"browser": {
"./lib/index.js": "./lib/index.es5.js",
Expand All @@ -22,7 +23,7 @@
"scripts": {
"preversion": "npm test",
"test": "../../node_modules/.bin/jest --no-watchman -c ./jest.config.js",
"test:es:version": "../../node_modules/.bin/es-check es5 ./lib/index.es5.js && ../../node_modules/.bin/es-check --module es11 ./lib/index.mjs && ../../node_modules/.bin/es-check --module es9 ./lib/index.es9.mjs",
"test:es:version": "../../node_modules/.bin/es-check es5 ./lib/index.es5.js && ../../node_modules/.bin/es-check --module es11 ./lib/index.mjs && ../../node_modules/.bin/es-check --module es9 ./lib/index.es9.mjs && ../../node_modules/.bin/es-check --module es9 ./lib/index.es9.cjs",
"build": "node_modules/.bin/rollup -c",
"prepare": "npm run build"
},
Expand Down
5 changes: 3 additions & 2 deletions packages/integration-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"import": "./lib/index.mjs",
"require": "./lib/index.cjs"
},
"./lib/index.es9.mjs": "./lib/index.es9.mjs"
"./lib/index.es9.mjs": "./lib/index.es9.mjs",
"./lib/index.es9.cjs": "./lib/index.es9.cjs"
},
"browser": {
"./lib/index.js": "./lib/index.es5.js",
Expand All @@ -21,7 +22,7 @@
"scripts": {
"preversion": "npm test",
"test": "../../node_modules/.bin/jest --no-watchman -c ./jest.config.js",
"test:es:version": "../../node_modules/.bin/es-check es5 ./lib/index.es5.js && ../../node_modules/.bin/es-check --module es11 ./lib/index.mjs && ../../node_modules/.bin/es-check --module es9 ./lib/index.es9.mjs",
"test:es:version": "../../node_modules/.bin/es-check es5 ./lib/index.es5.js && ../../node_modules/.bin/es-check --module es11 ./lib/index.mjs && ../../node_modules/.bin/es-check --module es9 ./lib/index.es9.mjs && ../../node_modules/.bin/es-check --module es9 ./lib/index.es9.cjs",
"build": "node_modules/.bin/rollup -c",
"prepare": "npm run build"
},
Expand Down
3 changes: 2 additions & 1 deletion packages/integration/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"require": "./lib/index.cjs"
},
"./lib/index.es9.mjs": "./lib/index.es9.mjs",
"./lib/index.es9.cjs": "./lib/index.es9.cjs",
"./server": "./server/index.js",
"./server/": "./server/index.js",
"./server/index.js": "./server/index.js"
Expand All @@ -25,7 +26,7 @@
"scripts": {
"preversion": "npm test",
"test": "../../node_modules/.bin/jest --no-watchman -c ./jest.config.js",
"test:es:version": "../../node_modules/.bin/es-check es5 ./lib/index.es5.js && ../../node_modules/.bin/es-check --module es11 ./lib/index.mjs && ../../node_modules/.bin/es-check --module es9 ./lib/index.es9.mjs",
"test:es:version": "../../node_modules/.bin/es-check es5 ./lib/index.es5.js && ../../node_modules/.bin/es-check --module es11 ./lib/index.mjs && ../../node_modules/.bin/es-check --module es9 ./lib/index.es9.mjs && ../../node_modules/.bin/es-check --module es9 ./lib/index.es9.cjs",
"build": "node_modules/.bin/rollup -c",
"prepare": "npm run build"
},
Expand Down
5 changes: 3 additions & 2 deletions packages/plugin-component/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
"import": "./lib/index.mjs",
"require": "./lib/index.cjs"
},
"./lib/index.es9.mjs": "./lib/index.es9.mjs"
"./lib/index.es9.mjs": "./lib/index.es9.mjs",
"./lib/index.es9.cjs": "./lib/index.es9.cjs"
},
"browser": {
"./lib/index.js": "./lib/index.es5.js",
Expand All @@ -22,7 +23,7 @@
"scripts": {
"preversion": "npm test",
"test": "../../node_modules/.bin/jest --no-watchman -c ./jest.config.js",
"test:es:version": "../../node_modules/.bin/es-check es5 ./lib/index.es5.js && ../../node_modules/.bin/es-check --module es11 ./lib/index.mjs && ../../node_modules/.bin/es-check --module es9 ./lib/index.es9.mjs",
"test:es:version": "../../node_modules/.bin/es-check es5 ./lib/index.es5.js && ../../node_modules/.bin/es-check --module es11 ./lib/index.mjs && ../../node_modules/.bin/es-check --module es9 ./lib/index.es9.mjs && ../../node_modules/.bin/es-check --module es9 ./lib/index.es9.cjs",
"build": "node_modules/.bin/rollup -c",
"prepare": "npm run build"
},
Expand Down
3 changes: 2 additions & 1 deletion packages/plugin-css-scrambler/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"require": "./lib/index.cjs"
},
"./lib/index.es9.mjs": "./lib/index.es9.mjs",
"./lib/index.es9.cjs": "./lib/index.es9.cjs",
"./postcss": "./postcss/index.js",
"./postcss/": "./postcss/index.js",
"./postcss/index.js": "./postcss/index.js",
Expand All @@ -28,7 +29,7 @@
"scripts": {
"preversion": "npm test",
"test": "../../node_modules/.bin/jest --no-watchman -c ./jest.config.js",
"test:es:version": "../../node_modules/.bin/es-check es5 ./lib/index.es5.js && ../../node_modules/.bin/es-check --module es11 ./lib/index.mjs && ../../node_modules/.bin/es-check --module es9 ./lib/index.es9.mjs",
"test:es:version": "../../node_modules/.bin/es-check es5 ./lib/index.es5.js && ../../node_modules/.bin/es-check --module es11 ./lib/index.mjs && ../../node_modules/.bin/es-check --module es9 ./lib/index.es9.mjs && ../../node_modules/.bin/es-check --module es9 ./lib/index.es9.cjs",
"build": "node_modules/.bin/rollup -c",
"prepare": "npm run build"
},
Expand Down
3 changes: 2 additions & 1 deletion packages/plugin-error/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"require": "./lib/index.cjs"
},
"./lib/index.es9.mjs": "./lib/index.es9.mjs",
"./lib/index.es9.cjs": "./lib/index.es9.cjs",
"./server": "./server/index.js",
"./server/": "./server/index.js",
"./server/index.js": "./server/index.js"
Expand All @@ -25,7 +26,7 @@
"scripts": {
"preversion": "npm test",
"test": "../../node_modules/.bin/jest --no-watchman -c ./jest.config.js",
"test:es:version": "../../node_modules/.bin/es-check es5 ./lib/index.es5.js && ../../node_modules/.bin/es-check --module es11 ./lib/index.mjs && ../../node_modules/.bin/es-check --module es9 ./lib/index.es9.mjs",
"test:es:version": "../../node_modules/.bin/es-check es5 ./lib/index.es5.js && ../../node_modules/.bin/es-check --module es11 ./lib/index.mjs && ../../node_modules/.bin/es-check --module es9 ./lib/index.es9.mjs && ../../node_modules/.bin/es-check --module es9 ./lib/index.es9.cjs",
"build": "node_modules/.bin/rollup -c",
"prepare": "npm run build"
},
Expand Down
5 changes: 3 additions & 2 deletions packages/plugin-event-emitter/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
"import": "./lib/index.mjs",
"require": "./lib/index.cjs"
},
"./lib/index.es9.mjs": "./lib/index.es9.mjs"
"./lib/index.es9.mjs": "./lib/index.es9.mjs",
"./lib/index.es9.cjs": "./lib/index.es9.cjs"
},
"browser": {
"./lib/index.js": "./lib/index.es5.js",
Expand All @@ -22,7 +23,7 @@
"scripts": {
"preversion": "npm test",
"test": "../../node_modules/.bin/jest --no-watchman -c ./jest.config.js",
"test:es:version": "../../node_modules/.bin/es-check es5 ./lib/index.es5.js && ../../node_modules/.bin/es-check --module es11 ./lib/index.mjs && ../../node_modules/.bin/es-check --module es9 ./lib/index.es9.mjs",
"test:es:version": "../../node_modules/.bin/es-check es5 ./lib/index.es5.js && ../../node_modules/.bin/es-check --module es11 ./lib/index.mjs && ../../node_modules/.bin/es-check --module es9 ./lib/index.es9.mjs && ../../node_modules/.bin/es-check --module es9 ./lib/index.es9.cjs",
"build": "node_modules/.bin/rollup -c",
"prepare": "npm run build"
},
Expand Down
5 changes: 3 additions & 2 deletions packages/plugin-http-client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
"import": "./lib/index.mjs",
"require": "./lib/index.cjs"
},
"./lib/index.es9.mjs": "./lib/index.es9.mjs"
"./lib/index.es9.mjs": "./lib/index.es9.mjs",
"./lib/index.es9.cjs": "./lib/index.es9.cjs"
},
"browser": {
"./lib/index.js": "./lib/index.es5.js",
Expand All @@ -22,7 +23,7 @@
"scripts": {
"preversion": "npm test",
"test": "../../node_modules/.bin/jest --no-watchman -c ./jest.config.js",
"test:es:version": "../../node_modules/.bin/es-check es5 ./lib/index.es5.js && ../../node_modules/.bin/es-check --module es11 ./lib/index.mjs && ../../node_modules/.bin/es-check --module es9 ./lib/index.es9.mjs",
"test:es:version": "../../node_modules/.bin/es-check es5 ./lib/index.es5.js && ../../node_modules/.bin/es-check --module es11 ./lib/index.mjs && ../../node_modules/.bin/es-check --module es9 ./lib/index.es9.mjs && ../../node_modules/.bin/es-check --module es9 ./lib/index.es9.cjs",
"build": "node_modules/.bin/rollup -c",
"prepare": "npm run build"
},
Expand Down
5 changes: 3 additions & 2 deletions packages/plugin-router/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"import": "./lib/index.mjs",
"require": "./lib/index.cjs"
},
"./lib/index.es9.mjs": "./lib/index.es9.mjs"
"./lib/index.es9.mjs": "./lib/index.es9.mjs",
"./lib/index.es9.cjs": "./lib/index.es9.cjs"
},
"browser": {
"./lib/index.js": "./lib/index.es5.js",
Expand All @@ -21,7 +22,7 @@
"scripts": {
"preversion": "npm test",
"test": "../../node_modules/.bin/jest --no-watchman -c ./jest.config.js",
"test:es:version": "../../node_modules/.bin/es-check es5 ./lib/index.es5.js && ../../node_modules/.bin/es-check --module es11 ./lib/index.mjs && ../../node_modules/.bin/es-check --module es9 ./lib/index.es9.mjs",
"test:es:version": "../../node_modules/.bin/es-check es5 ./lib/index.es5.js && ../../node_modules/.bin/es-check --module es11 ./lib/index.mjs && ../../node_modules/.bin/es-check --module es9 ./lib/index.es9.mjs && ../../node_modules/.bin/es-check --module es9 ./lib/index.es9.cjs",
"build": "node_modules/.bin/rollup -c",
"prepare": "npm run build"
},
Expand Down
5 changes: 3 additions & 2 deletions packages/tool-storybook/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"import": "./lib/index.mjs",
"require": "./lib/index.cjs"
},
"./lib/index.es9.mjs": "./lib/index.es9.mjs"
"./lib/index.es9.mjs": "./lib/index.es9.mjs",
"./lib/index.es9.cjs": "./lib/index.es9.cjs"
},
"browser": {
"./lib/index.js": "./lib/index.es5.js",
Expand All @@ -21,7 +22,7 @@
"scripts": {
"preversion": "npm test",
"test": "../../node_modules/.bin/jest --no-watchman -c ./jest.config.js",
"test:es:version": "../../node_modules/.bin/es-check es5 ./lib/index.es5.js && ../../node_modules/.bin/es-check --module es11 ./lib/index.mjs && ../../node_modules/.bin/es-check --module es9 ./lib/index.es9.mjs",
"test:es:version": "../../node_modules/.bin/es-check es5 ./lib/index.es5.js && ../../node_modules/.bin/es-check --module es11 ./lib/index.mjs && ../../node_modules/.bin/es-check --module es9 ./lib/index.es9.mjs && ../../node_modules/.bin/es-check --module es9 ./lib/index.es9.cjs",
"build": "node_modules/.bin/rollup -c",
"prepare": "npm run build"
},
Expand Down

0 comments on commit 6b0a4a1

Please sign in to comment.