Skip to content

Commit

Permalink
fix(vite-plugin): ship in dual package format for compatibility with …
Browse files Browse the repository at this point in the history
…Vite (lingui#1450)
  • Loading branch information
timofei-iatsenko authored Feb 21, 2023
1 parent 34e14cd commit e3a2b39
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
22 changes: 19 additions & 3 deletions packages/vite-plugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
"name": "@lingui/vite-plugin",
"version": "3.17.1",
"description": "Vite plugin for Lingui message catalogs",
"main": "./build/index.js",
"types": "./build/index.d.ts",
"main": "./build/cjs/index.js",
"module": "./build/esm/index.js",
"types": "./build/esm/index.d.ts",
"license": "MIT",
"keywords": [
"vite-plugin",
Expand All @@ -17,7 +18,10 @@
"translation"
],
"scripts": {
"build": "rimraf ./build && tsc"
"clean": "rimraf ./build",
"build:esm": "tsc --module esnext --outDir ./build/esm",
"build:cjs": "tsc --module commonjs --outDir ./build/cjs",
"build": "yarn clean && yarn build:esm && yarn build:cjs"
},
"repository": {
"type": "git",
Expand All @@ -26,6 +30,18 @@
"bugs": {
"url": "https://github.com/lingui/js-lingui/issues"
},
"exports": {
".": {
"require": {
"types": "./build/cjs/index.d.ts",
"default": "./build/cjs/index.js"
},
"import": {
"types": "./build/esm/index.d.ts",
"default": "./build/esm/index.js"
}
}
},
"engines": {
"node": ">=14.0.0"
},
Expand Down
1 change: 1 addition & 0 deletions packages/vite-plugin/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"sourceMap": true,
"noEmit": false,
"declaration": true,
"moduleResolution": "Node",
"outDir": "./build",
"esModuleInterop": true,
"resolveJsonModule": true
Expand Down

0 comments on commit e3a2b39

Please sign in to comment.