Skip to content

Commit 1b7dad0

Browse files
authored
chore: dedupe-cjs-outputs (#647)
* dedupe-cjs-outputs * fix
1 parent 875b03c commit 1b7dad0

File tree

3 files changed

+13
-7
lines changed

3 files changed

+13
-7
lines changed

package.json

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-spinners",
3-
"version": "0.17.0-beta.3",
3+
"version": "0.17.0-beta.4",
44
"description": "A collection of react loading spinners",
55
"repository": {
66
"type": "git",
@@ -29,19 +29,22 @@
2929
"progress",
3030
"activity"
3131
],
32-
"main": "index.js",
32+
"main": "cjs/index.js",
3333
"module": "esm/index.js",
34+
"exports": {
35+
"import": "./esm/index.js",
36+
"require": "./cjs/index.js"
37+
},
3438
"scripts": {
35-
"prepare": "$npm_execpath run build:cjs & $npm_execpath run build:esm && $npm_execpath run build",
36-
"build": "tsc --project tsconfig.cjs.json",
39+
"prepare": "$npm_execpath run clean && $npm_execpath run build:cjs & $npm_execpath run build:esm",
3740
"build:cjs": "tsc --project tsconfig.cjs.json --outDir cjs",
3841
"build:esm": "tsc --project tsconfig.esm.json --outDir esm",
3942
"build:demo": "$npm_execpath run vite build",
4043
"dev:demo": "vite dev",
4144
"patch": "npm version patch && npm publish && npm run clean",
4245
"minor": "npm version minor && npm publish && npm run clean",
4346
"major": "npm version major && npm publish && npm run clean",
44-
"clean": "rm -rf helpers/; rm -f *Loader.js; rm -f *Loader.d.ts; rm -f index.js; rm -f index.d.ts; rm -rf docs/js; rm -rf cjs; rm -rf esm",
47+
"clean": "rm -rf cjs; rm -rf esm",
4548
"lint": "eslint",
4649
"test": "jest",
4750
"coveralls": "cat ./coverage/lcov.info | ./node_modules/.bin/coveralls",

test-apps/nextjs/src/app/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import * as Loaders from "../../../../src/index";
1+
import * as Loaders from "esm/index";
22

33
export default function Home() {
44
return (

test-apps/nextjs/tsconfig.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,10 @@
1919
}
2020
],
2121
"paths": {
22-
"@/*": ["./src/*"]
22+
"@/*": ["./src/*"],
23+
"cjs/*": ["../../cjs/*"],
24+
"esm/*": ["../../esm/*"],
25+
"src/*": ["../../src/*"]
2326
}
2427
},
2528
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],

0 commit comments

Comments
 (0)