From 1f12480fa378afe34e180882efd16a16552528cb Mon Sep 17 00:00:00 2001 From: Angelo Reale <12191809+angeloreale@users.noreply.github.com> Date: Wed, 21 Aug 2024 01:41:35 +0100 Subject: [PATCH] [DPCP-65] Oneiros: CJS/ESM (#16) * ar(fix) [DPCP-65]: Adding Oneiros to Morpheus * ar(fix) [DPCP-65]: Adding Oneiros to Morpheus * ar(fix) [DPCP-65]: Adding Oneiros to Morpheus * ar(fix) [DPCP-65]: Adding Oneiros to Morpheus: let's house keep * ar(fix) [DPCP-65]: Adding Oneiros to Morpheus: let's house keep * ar(fix) [cherry-pick] date range colors * ar(fix) [cherry-pick] date range colors * ar(fix) [DPCP-65]: Adding Oneiros to Morpheus: let's house keep * ar(fix) [DPCP-65]: Adding Oneiros to Morpheus: let's house keep * ar(fix) [DPCP-65]: Adding Oneiros to Morpheus: let's house keep * ar(fix) [DPCP-65]: Adding Oneiros to Morpheus: let's house keep * ar(fix) [DPCP-65]: Adding Oneiros to Morpheus: let's house keep --- package.json | 23 ++++++++++++++++------- vite.config.ts | 5 +++++ 2 files changed, 21 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index a906159..0420e39 100644 --- a/package.json +++ b/package.json @@ -3,9 +3,18 @@ "version": "0.0.1", "description": "DreamPip's Design System Component Library.", "type": "module", - "main": "dist/cjs/index.cjs", - "module": "dist/esm/index.es.js", - "types": "dist/index.d.ts", + "exports": { + ".": { + "import": "./dist/esm/index.es.js", + "require": "./dist/cjs/index.server.cjs" + }, + "./styles": "./dist/esm/style.css", + "./dist/tailwind.config.js": { + "import": "./dist/esm/tailwind.config.js", + "require": "./dist/cjs/tailwind.config.js" + } + }, + "types": "dist/esm/index.d.ts", "repository": "https://github.com/dreampipcom/oneiros", "files": [ "/dist/**/*" @@ -40,13 +49,9 @@ "license": "HPL3-ECO-AND-ANC", "devDependencies": { "@chromatic-com/storybook": "1.3.3", - "@emotion/react": "11.11.4", - "@emotion/styled": "11.11.5", "@fullcalendar/daygrid": "^6.1.15", "@fullcalendar/react": "^6.1.15", "@fullcalendar/timegrid": "^6.1.15", - "@mui/material": "5.15.15", - "@mui/x-date-pickers-pro": "^7.8.0", "@snyk/protect": "latest", "@storybook/addon-a11y": "8.0.10", "@storybook/addon-essentials": "8.0.10", @@ -93,6 +98,10 @@ "vitest": "1.5.0" }, "peerDependencies": { + "@emotion/react": "11.11.4", + "@emotion/styled": "11.11.5", + "@mui/material": "5.15.15", + "@mui/x-date-pickers-pro": "^7.8.0", "clsx": "2.1.0", "lazysizes": "^5.3.2", "moment": "^2.30.1", diff --git a/vite.config.ts b/vite.config.ts index 70b461f..b7930b4 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -48,6 +48,7 @@ export default defineConfig((env) => { : { build: { // cjs + ssr: 'index.server.cjs', outDir: './dist/cjs', lib: { entry: './src/index.ts', @@ -67,6 +68,10 @@ export default defineConfig((env) => { } defaultHandler(warning); }, + output: { + format: 'cjs', + entryFileNames: 'index.server.cjs', + }, }, sourcemap: true, emptyOutDir: false,