From 2237822c5089d85b942a8480f203d58f752d9e9a Mon Sep 17 00:00:00 2001 From: Hiroki Miyaji Date: Mon, 2 Jan 2023 18:04:26 +0900 Subject: [PATCH] fix: enable to import `LazyLoadProps` --- package-lock.json | 14 +++++++------- package.json | 10 +++++----- rollup.config.mjs | 7 +++++-- 3 files changed, 17 insertions(+), 14 deletions(-) diff --git a/package-lock.json b/package-lock.json index 5064d2e..2f03eb7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -55,7 +55,7 @@ "semantic-release": "19.0.5", "ts-jest": "29.0.3", "ts-loader": "9.4.2", - "typescript": "4.8.4" + "typescript": "4.9.4" }, "peerDependencies": { "react": ">=18.0.0", @@ -19080,9 +19080,9 @@ } }, "node_modules/typescript": { - "version": "4.8.4", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.8.4.tgz", - "integrity": "sha512-QCh+85mCy+h0IGff8r5XWzOVSbBO+KfeYrMQh7NJ58QujwcE22u+NUSmUxqF+un70P9GXKxa2HCNiTTMJknyjQ==", + "version": "4.9.4", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.4.tgz", + "integrity": "sha512-Uz+dTXYzxXXbsFpM86Wh3dKCxrQqUcVMxwU54orwlJjOpO3ao8L7j5lH+dWfTwgCwIuM9GQ2kvVotzYJMXTBZg==", "dev": true, "bin": { "tsc": "bin/tsc", @@ -34346,9 +34346,9 @@ } }, "typescript": { - "version": "4.8.4", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.8.4.tgz", - "integrity": "sha512-QCh+85mCy+h0IGff8r5XWzOVSbBO+KfeYrMQh7NJ58QujwcE22u+NUSmUxqF+un70P9GXKxa2HCNiTTMJknyjQ==", + "version": "4.9.4", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.4.tgz", + "integrity": "sha512-Uz+dTXYzxXXbsFpM86Wh3dKCxrQqUcVMxwU54orwlJjOpO3ao8L7j5lH+dWfTwgCwIuM9GQ2kvVotzYJMXTBZg==", "dev": true }, "uglify-js": { diff --git a/package.json b/package.json index 0988e5a..743b1eb 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "version": "4.1.3", "description": "React Lazy Load Component for your Website Performance🚀", "main": "dist/cjs/index.js", - "module": "dist/es/index.js", + "module": "dist/index.js", "exports": { "development": { "require": "./dist/cjs/index.development.js", @@ -11,7 +11,7 @@ }, "production": { "require": "./dist/cjs/index.js", - "default": "./dist/es/index.js" + "default": "./dist/index.js" } }, "types": "dist/index.d.ts", @@ -30,7 +30,7 @@ "postdeploy:examples": "npm run uninstall-local-pkg", "prebuild": "rm -rf dist", "build": "rollup -c", - "postbuild": "cp dist/es/index.d.ts dist/index.d.ts && cp dist/es/index.d.ts.map dist/index.d.ts.map && find dist | grep -E '^dist/.+/index\\.d\\.ts(\\.map)?$' | xargs rm -rf", + "postbuild": "find dist | grep -E '^dist/.+/index\\.d\\.ts(\\.map)?$' | xargs rm -rf", "test": "jest --runInBand", "posttest": "npm run uninstall-local-pkg", "lint": "eslint src/", @@ -100,7 +100,7 @@ "semantic-release": "19.0.5", "ts-jest": "29.0.3", "ts-loader": "9.4.2", - "typescript": "4.8.4" + "typescript": "4.9.4" }, "peerDependencies": { "react": ">=18.0.0", @@ -132,7 +132,7 @@ "path": "umd/index.js" }, { - "path": "es/index.js" + "path": "index.js" } ] } diff --git a/rollup.config.mjs b/rollup.config.mjs index 2ffe025..cbbb599 100644 --- a/rollup.config.mjs +++ b/rollup.config.mjs @@ -19,7 +19,7 @@ const productionConfigs = outputFormats.map(format => ({ input, output: [ { - file: `dist/${format}/index.js`, + file: format === 'es' ? 'dist/index.js' : `dist/${format}/index.js`, format, sourcemap: tsConfigJson.compilerOptions.sourceMap, name, @@ -40,7 +40,10 @@ const developmentConfigs = outputFormats.map(format => ({ input, output: [ { - file: `dist/${format}/index.development.js`, + file: + format === 'es' + ? 'dist/index.development.js' + : `dist/${format}/index.development.js`, format, name, },