Skip to content

Commit

Permalink
compile context.ts, ssg.ts and locales.ts to esm (#767)
Browse files Browse the repository at this point in the history
  • Loading branch information
dimaMachina committed Sep 1, 2022
1 parent bc52178 commit a2bc427
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 30 deletions.
5 changes: 5 additions & 0 deletions .changeset/proud-bikes-brush.md
@@ -0,0 +1,5 @@
---
'nextra': patch
---

compile `context.ts`, `ssg.ts` and `locales.ts` to esm
14 changes: 1 addition & 13 deletions packages/nextra/package.json
Expand Up @@ -38,23 +38,11 @@
"exports": {
"./package.json": "./package.json",
".": "./dist/index.js",
"./context": {
"import": "./dist/context.js",
"types": "./dist/context.d.ts"
},
"./data": {
"import": "./dist/ssg.js",
"types": "./dist/ssg.d.ts"
},
"./ssg": {
"import": "./dist/ssg.js",
"import": "./dist/ssg.mjs",
"types": "./dist/ssg.d.ts"
},
"./loader": "./loader.js",
"./locales": {
"import": "./dist/locales.js",
"types": "./dist/locales.d.ts"
},
"./icons": {
"import": "./dist/icons/index.mjs",
"types": "./dist/icons/index.d.ts"
Expand Down
22 changes: 5 additions & 17 deletions packages/nextra/tsup.config.ts
Expand Up @@ -11,32 +11,20 @@ export default defineConfig([
dts: false,
target
},
{
name: 'nextra-utils',
entry: ['src/ssg.ts', 'src/locales.ts', 'src/context.ts'],
format: 'cjs',
external: ['next/server'],
dts: true,
target
},
{
name: 'nextra-loader',
entry: ['src/loader.ts'],
format: 'esm',
dts: true,
target
},
{
name: 'nextra-esm',
entry: [
'src/loader.ts',
'src/compile.ts',
'src/icons/index.ts',
'src/components/index.ts'
'src/components/index.ts',
'src/ssg.ts',
'src/locales.ts',
'src/context.ts'
],
format: 'esm',
dts: true,
target,
target
},
{
entry: ['src/types.ts'],
Expand Down

0 comments on commit a2bc427

Please sign in to comment.