Skip to content

Commit 6879782

Browse files
committed
feat: prefer esm format
1 parent a2b8e3b commit 6879782

File tree

20 files changed

+661
-403
lines changed

20 files changed

+661
-403
lines changed

.changeset/purple-pumas-listen.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@tailwindcss-mangle/config": major
3+
---
4+
5+
feat: prefer esm module

.changeset/selfish-foxes-learn.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@tailwindcss-mangle/shared": major
3+
---
4+
5+
feat: prefer esm module

package.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,10 @@
4545
"@icebreakers/eslint-config": "^0.6.1",
4646
"@icebreakers/monorepo": "^0.6.11",
4747
"@icebreakers/stylelint-config": "^0.1.2",
48-
"@rollup/pluginutils": "^5.1.2",
48+
"@rollup/pluginutils": "^5.1.3",
4949
"@tailwindcss-mangle/core": "workspace:*",
5050
"@tailwindcss-mangle/shared": "workspace:*",
51-
"@tsconfig/recommended": "^1.0.7",
51+
"@tsconfig/recommended": "^1.0.8",
5252
"@types/babel__generator": "^7.6.8",
5353
"@types/babel__helper-plugin-utils": "^7.10.3",
5454
"@types/babel__traverse": "^7.20.6",
@@ -61,7 +61,7 @@
6161
"@types/lodash": "^4.17.12",
6262
"@types/lodash-es": "^4.17.12",
6363
"@types/micromatch": "^4.0.9",
64-
"@types/node": "^22.7.7",
64+
"@types/node": "^22.8.1",
6565
"@types/resolve": "^1.20.6",
6666
"@types/semver": "^7.5.8",
6767
"@types/set-value": "^4.0.3",
@@ -80,7 +80,7 @@
8080
"fs-extra": "^11.2.0",
8181
"get-value": "^3.0.1",
8282
"html-minifier-terser": "^7.2.0",
83-
"html-webpack-plugin": "^5.6.2",
83+
"html-webpack-plugin": "^5.6.3",
8484
"husky": "^9.1.6",
8585
"klaw": "^4.1.0",
8686
"lint-staged": "^15.2.10",
@@ -104,14 +104,14 @@
104104
"tailwindcss-patch": "workspace:*",
105105
"tailwindcss2": "npm:@tailwindcss/postcss7-compat@^2.2.17",
106106
"tslib": "^2.8.0",
107-
"tsup": "^8.3.0",
108-
"tsx": "^4.19.1",
107+
"tsup": "^8.3.5",
108+
"tsx": "^4.19.2",
109109
"turbo": "^2.2.1",
110110
"typescript": "^5.6.3",
111111
"unbuild": "^2.0.0",
112112
"unplugin": "^1.14.1",
113113
"unplugin-tailwindcss-mangle": "workspace:*",
114-
"vite": "^5.4.9",
114+
"vite": "^5.4.10",
115115
"vite-tsconfig-paths": "^5.0.1",
116116
"vitest": "~2.1.3",
117117
"webpack": "^5.95.0",

packages/config/build.config.ts

Lines changed: 0 additions & 19 deletions
This file was deleted.

packages/config/package.json

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"name": "@tailwindcss-mangle/config",
3+
"type": "module",
34
"version": "3.0.0",
45
"description": "The config and load function of tailwindcss-mangle",
56
"author": "SonOfMagic <[email protected]>",
@@ -20,14 +21,14 @@
2021
],
2122
"exports": {
2223
".": {
23-
"types": "./dist/index.d.ts",
24-
"import": "./dist/index.mjs",
25-
"require": "./dist/index.cjs"
24+
"types": "./src/index.ts",
25+
"import": "./src/index.ts",
26+
"require": "./src/index.ts"
2627
}
2728
},
28-
"main": "./dist/index.cjs",
29-
"module": "./dist/index.mjs",
30-
"types": "./dist/index.d.ts",
29+
"main": "./src/index.ts",
30+
"module": "./src/index.ts",
31+
"types": "./src/index.ts",
3132
"typesVersions": {
3233
"*": {
3334
"*": [
@@ -40,14 +41,24 @@
4041
"dist"
4142
],
4243
"scripts": {
43-
"dev": "unbuild --sourcemap",
44-
"build": "unbuild",
44+
"dev": "tsup --watch --sourcemap",
45+
"build": "tsup",
4546
"test": "vitest run --coverage.enabled",
4647
"test:dev": "vitest"
4748
},
4849
"publishConfig": {
4950
"access": "public",
50-
"registry": "https://registry.npmjs.org/"
51+
"registry": "https://registry.npmjs.org/",
52+
"exports": {
53+
".": {
54+
"types": "./dist/index.d.ts",
55+
"import": "./dist/index.js",
56+
"require": "./dist/index.cjs"
57+
}
58+
},
59+
"main": "./dist/index.cjs",
60+
"module": "./dist/index.js",
61+
"types": "./dist/index.d.ts"
5162
},
5263
"dependencies": {
5364
"@tailwindcss-mangle/shared": "workspace:^",

packages/config/src/defaults.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { CSS_LANGS_RE } from 'is-css-request'
55

66
const defaultPipelineInclude = ['**/*.{html,js,ts,jsx,tsx,vue,svelte,astro,elm,php,phtml,mdx,md}', CSS_LANGS_RE]
77

8-
const defaultPipelineExclude = [/[\\/](node_modules|dist|\.temp|\.cache|\.vscode)[\\/]/]
8+
const defaultPipelineExclude: string[] = []
99

1010
export function getDefaultPatchConfig(): PatchUserConfig {
1111
return {

packages/config/test/__snapshots__/defaults.test.ts.snap

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,7 @@ exports[`defaults > getDefaultUserConfig 1`] = `
2121
"loose": true,
2222
},
2323
"disabled": false,
24-
"exclude": [
25-
/\\[\\\\\\\\/\\]\\(node_modules\\|dist\\|\\\\\\.temp\\|\\\\\\.cache\\|\\\\\\.vscode\\)\\[\\\\\\\\/\\]/,
26-
],
24+
"exclude": [],
2725
"include": [
2826
"**/*.{html,js,ts,jsx,tsx,vue,svelte,astro,elm,php,phtml,mdx,md}",
2927
/\\\\\\.\\(css\\|less\\|sass\\|scss\\|styl\\|stylus\\|pcss\\|postcss\\|sss\\)\\(\\?:\\$\\|\\\\\\?\\)/,

packages/config/test/__snapshots__/index.test.ts.snap

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,7 @@ exports[`config > 2.mangle-options 1`] = `
1313
"loose": false,
1414
},
1515
"disabled": false,
16-
"exclude": [
17-
/\\[\\\\\\\\/\\]\\(node_modules\\|dist\\|\\\\\\.temp\\|\\\\\\.cache\\|\\\\\\.vscode\\)\\[\\\\\\\\/\\]/,
18-
],
16+
"exclude": [],
1917
"include": [
2018
"**/*.{html,js,ts,jsx,tsx,vue,svelte,astro,elm,php,phtml,mdx,md}",
2119
/\\\\\\.\\(css\\|less\\|sass\\|scss\\|styl\\|stylus\\|pcss\\|postcss\\|sss\\)\\(\\?:\\$\\|\\\\\\?\\)/,

packages/core/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,9 @@
5252
},
5353
"dependencies": {
5454
"@ast-core/escape": "^1.0.1",
55-
"@babel/parser": "^7.25.9",
55+
"@babel/parser": "^7.26.1",
5656
"@babel/traverse": "^7.25.9",
57-
"@babel/types": "^7.25.9",
57+
"@babel/types": "^7.26.0",
5858
"@tailwindcss-mangle/config": "workspace:^",
5959
"@tailwindcss-mangle/shared": "workspace:^",
6060
"fast-sort": "^3.4.1",
@@ -63,6 +63,6 @@
6363
"magic-string": "^0.30.12",
6464
"pathe": "^1.1.2",
6565
"postcss": "^8.4.47",
66-
"postcss-selector-parser": "^6.1.2"
66+
"postcss-selector-parser": "^7.0.0"
6767
}
6868
}

packages/core/src/css/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { ICssHandlerOptions, IHandlerTransformResult } from '@/types'
1+
import type { ICssHandlerOptions, IHandlerTransformResult } from '../types'
22
import postcss from 'postcss'
33
import { transformSelectorPostcssPlugin } from './plugins'
44

0 commit comments

Comments
 (0)