Skip to content

Commit

Permalink
Merge pull request #67 from storybookjs/fix/separate-esm-cjs-dist
Browse files Browse the repository at this point in the history
fix the issues after adding esm
  • Loading branch information
ndelangen authored May 17, 2021
2 parents 75938cc + 175007b commit 4bbaf7a
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,16 @@
"dist/*"
],
"license": "MIT",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"main": "dist/cjs/index.js",
"types": "dist/types/index.d.ts",
"module": "dist/index.mjs",
"exports": {
"import": "./dist/index.mjs",
"require": "./dist/index.js"
"import": "./dist/esm/index.mjs",
"require": "./dist/cjs/index.js"
},
"scripts": {
"build:cjs": "babel src --out-dir dist --extensions \".ts\" --out-file-extension .js",
"build:esm": "BABEL_ESM=true babel src --out-dir dist --extensions \".ts\" --out-file-extension .mjs",
"build:cjs": "babel src --out-dir dist/cjs --extensions \".ts\"",
"build:esm": "BABEL_ESM=true babel src --out-dir dist/esm --extensions \".ts\"",
"build:tsc": "tsc --emitDeclarationOnly",
"build": "yarn build:cjs && yarn build:esm && yarn build:tsc",
"lint": "eslint src --ext .js,.ts",
Expand Down Expand Up @@ -73,7 +73,7 @@
"babel-jest": "^26.6.3",
"common-tags": "^1.8.0",
"eslint": "^7.23.0",
"jest": "^26.6.3",
"jest": "^26.6.3",
"prettier": "^2.2.1",
"regenerator-runtime": "^0.13.7",
"typescript": "^4.2.3"
Expand Down
2 changes: 1 addition & 1 deletion test/browser/index.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as src from '../../src';
import * as dist from '../../dist';
import * as dist from '../../dist/cjs';

const tests = ({ stringify, parse }) => {
test('HTML Event', () => {
Expand Down
2 changes: 1 addition & 1 deletion test/common/index.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as src from '../../src';
import * as dist from '../../dist';
import * as dist from '../../dist/cjs';

const regex1 = /foo/;
const regex2 = /foo/g;
Expand Down
2 changes: 1 addition & 1 deletion test/node/index.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as src from '../../src';
import * as dist from '../../dist';
import * as dist from '../../dist/cjs';

const tests = ({ stringify }) => {
test('stringify the global object', () => {
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"noImplicitAny": true,
"esModuleInterop": true,
"types": ["jest"],
"outDir": "dist"
"outDir": "dist/types"
},
"include": ["src"],
"exclude": ["dist"]
Expand Down

0 comments on commit 4bbaf7a

Please sign in to comment.