Skip to content

Commit

Permalink
feat: support loading ts config files in esm contexts (#249)
Browse files Browse the repository at this point in the history
* feat: support loading ts config files in esm contexts

* throw jiti error only when importing ts files
  • Loading branch information
brc-dd committed Nov 30, 2023
1 parent cdbba5a commit 6c4e3e0
Show file tree
Hide file tree
Showing 21 changed files with 321 additions and 553 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,23 +86,25 @@ plugins:
### `.postcssrc.js` or `postcss.config.js`

You may need some logic within your config.
In this case create JS file named:
In this case create JS/TS file named:
- `.postcssrc.js`
- `.postcssrc.mjs`
- `.postcssrc.cjs`
- `.postcssrc.ts`
- `.postcssrc.mts`
- `.postcssrc.cts`
- `postcss.config.js`
- `postcss.config.mjs`
- `postcss.config.cjs`
- `postcss.config.ts`
- `postcss.config.mts`
- `postcss.config.cts`

```
Project (Root)
|– client
|– public
|- (.postcssrc|postcss.config).(js|mjs|cjs|ts|cts)
|- (.postcssrc|postcss.config).(js|mjs|cjs|ts|mts|cts)
|- package.json
```

Expand Down
21 changes: 10 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
"src"
],
"engines": {
"node": ">= 14"
"node": ">= 16"
},
"scripts": {
"lint": "standard",
"test": "pnpm lint && c8 pnpm unit",
"unit": "tsm node_modules/uvu/bin.js . '\\.test\\.(ts|js)$'",
"unit": "uvu . '\\.test\\.js$'",
"docs": "jsdoc2md src/*.js > DOCS.md",
"clean": "npx rimraf ./coverage",
"release": "standard-version"
Expand All @@ -33,28 +33,27 @@
"yaml": "^2.3.4"
},
"devDependencies": {
"@types/node": "^20.9.2",
"@types/node": "^20.10.0",
"@types/postcss-import": "^14.0.3",
"c8": "^8.0.1",
"clean-publish": "^4.2.0",
"cssnano": "^6.0.1",
"jiti": "^1.21.0",
"jsdoc-to-markdown": "^8.0.0",
"postcss": "^8.4.31",
"postcss-import": "^15.1.0",
"postcss-nested": "^6.0.1",
"standard": "^17.1.0",
"sugarss": "^4.0.1",
"ts-node": "^10.9.1",
"tsm": "^2.3.0",
"typescript": "5.2.2",
"typescript": "5.3.2",
"uvu": "^0.5.6"
},
"peerDependencies": {
"postcss": ">=8.0.9",
"ts-node": ">=9.0.0"
"jiti": ">=1.21.0",
"postcss": ">=8.0.9"
},
"peerDependenciesMeta": {
"ts-node": {
"jiti": {
"optional": true
},
"postcss": {
Expand All @@ -63,9 +62,9 @@
},
"c8": {
"exclude": [
"**/*.test.*"
"test/**/*"
],
"lines": 97.8,
"lines": 100,
"check-coverage": true
},
"prettier": {
Expand Down

0 comments on commit 6c4e3e0

Please sign in to comment.