Skip to content

Commit

Permalink
feat: provide ES Module build
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisvxd committed Aug 31, 2024
1 parent 9cd030f commit 87df145
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 4 deletions.
4 changes: 2 additions & 2 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@
"types": "./dist/index.d.ts",
"exports": {
".": {
"import": "./dist/index.js",
"import": "./dist/index.mjs",
"require": "./dist/index.js",
"types": "./dist/index.d.ts"
},
"./rsc": {
"import": "./dist/rsc.js",
"import": "./dist/rsc.mjs",
"require": "./dist/rsc.js",
"types": "./dist/rsc.d.ts"
},
Expand Down
4 changes: 4 additions & 0 deletions packages/field-contentful/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
"private": false,
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"exports": {
"import": "./dist/index.mjs",
"types": "./dist/index.d.ts"
},
"license": "MIT",
"scripts": {
"lint": "eslint \"**/*.ts*\"",
Expand Down
4 changes: 4 additions & 0 deletions packages/plugin-emotion-cache/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
"private": false,
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"exports": {
"import": "./dist/index.mjs",
"types": "./dist/index.d.ts"
},
"license": "MIT",
"scripts": {
"lint": "eslint \"**/*.ts*\"",
Expand Down
4 changes: 4 additions & 0 deletions packages/plugin-heading-analyzer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
"private": false,
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"exports": {
"import": "./dist/index.mjs",
"types": "./dist/index.d.ts"
},
"license": "MIT",
"scripts": {
"lint": "eslint \"**/*.ts*\"",
Expand Down
6 changes: 4 additions & 2 deletions packages/tsup-config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@ import fs from "fs";
import path from "path";
import postcss from "postcss";
import postcssModules from "postcss-modules";
import type { Options } from "tsup";

const config = {
const config: Options = {
dts: true,
format: "cjs",
format: ["cjs", "esm"],
inject: ["../tsup-config/react-import.js"],
external: ["react", "react-dom"],
esbuildPlugins: [
{
name: "css-module",
Expand Down

0 comments on commit 87df145

Please sign in to comment.