Skip to content

Commit

Permalink
Revert "chore: Add type: "module" and use .mjs extension (#1604)" (
Browse files Browse the repository at this point in the history
…#1618)

This reverts commit 396644f.
  • Loading branch information
huozhi committed Nov 6, 2021
1 parent 37ba0e9 commit 4f8d0b9
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 14 deletions.
3 changes: 1 addition & 2 deletions immutable/package.json
@@ -1,9 +1,8 @@
{
"name": "swr-immutable",
"version": "0.0.1",
"type": "module",
"main": "./dist/index.js",
"module": "./dist/index.mjs",
"module": "./dist/index.esm.js",
"types": "./dist/immutable",
"peerDependencies": {
"swr": "*",
Expand Down
3 changes: 1 addition & 2 deletions infinite/package.json
@@ -1,9 +1,8 @@
{
"name": "swr-infinite",
"version": "0.0.1",
"type": "module",
"main": "./dist/index.js",
"module": "./dist/index.mjs",
"module": "./dist/index.esm.js",
"types": "./dist/infinite",
"peerDependencies": {
"swr": "*",
Expand Down
8 changes: 4 additions & 4 deletions jest.config.js
@@ -1,4 +1,4 @@
export default {
module.exports = {
testEnvironment: 'jsdom',
testRegex: '/test/.*\\.test\\.tsx$',
modulePathIgnorePatterns: ['<rootDir>/examples/'],
Expand All @@ -8,10 +8,10 @@ export default {
'@swc-node/jest',
{
jsc: {
minify: false
minify: false,
}
}
]
},
],
},
coveragePathIgnorePatterns: ['/node_modules/', '/dist/', '/test/'],
coverageProvider: 'v8',
Expand Down
11 changes: 5 additions & 6 deletions package.json
Expand Up @@ -2,28 +2,27 @@
"name": "swr",
"version": "1.1.0-beta.8",
"description": "React Hooks library for remote data fetching",
"type": "module",
"main": "./dist/index.js",
"module": "./dist/index.mjs",
"module": "./dist/index.esm.js",
"exports": {
"./package.json": "./package.json",
".": {
"import": "./dist/index.mjs",
"import": "./dist/index.esm.js",
"require": "./dist/index.js",
"types": "./dist/index.d.ts"
},
"./infinite": {
"import": "./infinite/dist/index.mjs",
"import": "./infinite/dist/index.esm.js",
"require": "./infinite/dist/index.js",
"types": "./infinite/dist/infinite/index.d.ts"
},
"./immutable": {
"import": "./immutable/dist/index.mjs",
"import": "./immutable/dist/index.esm.js",
"require": "./immutable/dist/index.js",
"types": "./immutable/dist/immutable/index.d.ts"
}
},
"react-native": "./dist/index.mjs",
"react-native": "./dist/index.esm.js",
"types": "./dist/index.d.ts",
"files": [
"dist/**",
Expand Down

0 comments on commit 4f8d0b9

Please sign in to comment.