diff --git a/package.json b/package.json index a567fa39a..4a3c314bd 100644 --- a/package.json +++ b/package.json @@ -7,10 +7,17 @@ "homepage": "https://github.com/Hacker0x01/react-datepicker", "main": "dist/index.js", "types": "dist/index.d.ts", - "browser": "dist/react-datepicker.min.js", "module": "dist/es/index.js", "unpkg": "dist/react-datepicker.min.js", "style": "dist/react-datepicker.min.css", + "exports": { + ".": { + "import": "./dist/es/index.js", + "require": "./dist/index.js", + "types": "./dist/index.d.ts", + "default": "./dist/es/index.js" + } + }, "files": ["*.md", "dist", "lib", "es", "src/stylesheets"], "sideEffects": ["**/*.css"], "keywords": ["react", "datepicker", "calendar", "date", "react-component"], diff --git a/rollup.config.mjs b/rollup.config.mjs index 802246554..32ae6c49c 100644 --- a/rollup.config.mjs +++ b/rollup.config.mjs @@ -26,7 +26,10 @@ const banner = `/*! const globals = { react: "React", - "prop-types": "PropTypes", + "react-dom": "ReactDOM", + clsx: "clsx", + "date-fns": "dateFns", + "@floating-ui/react": "FloatingUIReact", }; // NOTE:https://rollupjs.org/migration/#changed-defaults @@ -40,7 +43,7 @@ const config = { input: "src/index.tsx", output: [ { - file: pkg.browser, + file: pkg.unpkg, format: "umd", name: "DatePicker", globals, @@ -49,7 +52,7 @@ const config = { plugins: [terser()], }, { - file: pkg.browser.replace(".min.js", ".js"), + file: pkg.unpkg.replace(".min.js", ".js"), format: "umd", sourcemap: "inline", name: "DatePicker",