Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dual-package ESM and CJS #7

Merged
merged 2 commits into from
Mar 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,4 @@ yarn-error.log
coverage/

# build products
index.js
index.d.ts
dist/*
2 changes: 1 addition & 1 deletion eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export default tseslint.config(
eslint.configs.recommended,
...tseslint.configs.recommended,
{
ignores: ["coverage/*", "index.js", "index.test.mjs", "index.d.ts"],
ignores: ["coverage/*", "dist"],
},
{
languageOptions: {
Expand Down
18 changes: 15 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"postcss-assign-layer"
],
"scripts": {
"build": "tsc -p tsconfig.json",
"build": "tsup src/index.ts --format esm,cjs --dts",
"test": "vitest run --coverage && eslint .",
"test:watch": "vitest",
"prepublishOnly": "pnpm build && pnpm test"
Expand All @@ -22,9 +22,20 @@
},
"homepage": "https://github.com/DefinedNet/postcss-assign-layer#readme",
"files": [
"index.js",
"index.d.ts"
"dist"
],
"exports": {
".": {
"types": {
"import": "./dist/index.d.mts",
"require": "./dist/index.d.ts"
},
"import": "./dist/index.mjs",
"require": "./dist/index.js"
},
"./package.json": "./package.json"
},
"main": "dist/index.js",
"engines": {
"node": ">=12.0.0"
},
Expand All @@ -43,6 +54,7 @@
"eslint-plugin-no-only-tests": "^3.1.0",
"postcss": "^8.3.11",
"prettier": "^2.6.2",
"tsup": "^8.0.2",
"typescript": "^5.4.2",
"typescript-eslint": "^7.3.1",
"vite": "^4.0.0",
Expand Down
Loading
Loading