Skip to content

Commit

Permalink
fix: compatiable with tailwindcss v3.3.0 (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
await-ovo committed Apr 3, 2023
1 parent e5f76ed commit 97bd783
Show file tree
Hide file tree
Showing 11 changed files with 3,285 additions and 2,950 deletions.
File renamed without changes.
2 changes: 1 addition & 1 deletion examples/craco/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-scripts": "5.0.1",
"tailwindcss": "^3.1.8",
"tailwindcss": "^3.3.1",
"tailwindcss-webpack-plugin": "workspace:*",
"typescript": "^4.8.4",
"web-vitals": "^2.1.4"
Expand Down
2 changes: 1 addition & 1 deletion examples/next.js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"@types/react": "17.0.38",
"autoprefixer": "^10.4.12",
"postcss": "^8.4.17",
"tailwindcss": "^3.1.8",
"tailwindcss": "^3.3.1",
"tailwindcss-webpack-plugin": "workspace:*",
"typescript": "4.5.4"
}
Expand Down
8 changes: 4 additions & 4 deletions examples/vite-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
"@types/react": "^18.0.17",
"@types/react-dom": "^18.0.6",
"@vitejs/plugin-react": "^2.1.0",
"typescript": "^4.6.4",
"vite": "^4",
"tailwindcss": "^3.1.8",
"autoprefixer": "^10.4.12",
"postcss": "^8.4.17",
"tailwindcss-vite-plugin": "workspace:*"
"tailwindcss": "^3.3.1",
"tailwindcss-vite-plugin": "workspace:*",
"typescript": "^4.6.4",
"vite": "^4"
}
}
6 changes: 3 additions & 3 deletions examples/vite-vue/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
},
"devDependencies": {
"@vitejs/plugin-vue": "^3.1.0",
"vite": "^3.1.0",
"tailwindcss": "^3.1.8",
"autoprefixer": "^10.4.12",
"postcss": "^8.4.17",
"tailwindcss-vite-plugin": "workspace:*"
"tailwindcss": "^3.3.1",
"tailwindcss-vite-plugin": "workspace:*",
"vite": "^3.1.0"
}
}
2 changes: 1 addition & 1 deletion examples/vue/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
},
"dependencies": {
"core-js": "^3.25.5",
"tailwindcss": "^3.1.8",
"tailwindcss": "^3.3.1",
"vue": "^3.2.40"
},
"devDependencies": {
Expand Down
16 changes: 8 additions & 8 deletions packages/utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,21 @@
"dev": "pnpm run build -- --watch"
},
"dependencies": {
"debug": "^4.3.4",
"fast-glob": "^3.2.12",
"normalize-path": "^3.0.0",
"tailwind-config-viewer": "^1.7.2",
"debug": "^4.3.4"
"tailwind-config-viewer": "^1.7.2"
},
"devDependencies": {
"@types/normalize-path": "^3.0.0",
"@types/debug": "^4.1.7",
"@types/normalize-path": "^3.0.0",
"@types/tailwindcss": "^3.1.0",
"tsup": "^6.2.3",
"tailwindcss": "^3.1.8",
"postcss": "^8.4.17"
"postcss": "^8.4.17",
"tailwindcss": "^3.3.1",
"tsup": "^6.2.3"
},
"peerDependencies": {
"tailwindcss": "^3.1.8",
"postcss": "^8.4.17"
"postcss": "^8.4.17",
"tailwindcss": "^3.1.8"
}
}
11 changes: 5 additions & 6 deletions packages/utils/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {
import type { PluginCreator } from 'postcss';
import type { IncomingMessage, ServerResponse } from 'http';
import type { ChangedContent, UserOptions } from './types';
import type { Config as TailwindConfig } from 'tailwindcss';
import type { Config, Config as TailwindConfig } from 'tailwindcss';

// import cjs module.
const require = createRequire(PACKAGE_DIR);
Expand All @@ -27,7 +27,7 @@ const {
const {
default: getModuleDependencies,
}: {
default: (file: string) => Array<{ file: string; requires: string[] }>;
default: (file: string) => Set<string>;
} = require('tailwindcss/lib/lib/getModuleDependencies');

const createServer = require('tailwind-config-viewer/server');
Expand Down Expand Up @@ -100,13 +100,12 @@ export const loadConfiguration = (
}
}

let config = resolveConfig(
let config = resolveConfig<Config>(
configPath && existsSync(configPath) ? require(configPath) : {},
);
) as TailwindConfig;

if (configPath && existsSync(configPath)) {
const deps = getModuleDependencies(configPath).map(({ file }) => file);
dependencies = new Set(deps);
dependencies = getModuleDependencies(configPath);
}

return {
Expand Down
2 changes: 1 addition & 1 deletion packages/vite-plugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@
"vite": "^3 || ^4"
},
"dependencies": {
"tailwindcss": "^3.1.8",
"postcss": "^8.4.17",
"tailwindcss": "^3.3.1",
"tailwindcss-webpack-plugin-utils": "workspace:*"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/webpack-plugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"dependencies": {
"get-port-please": "^2.6.1",
"postcss": "^8.4.17",
"tailwindcss": "^3.1.8",
"tailwindcss": "^3.3.1",
"tailwindcss-webpack-plugin-utils": "workspace:*"
},
"peerDependencies": {
Expand Down

0 comments on commit 97bd783

Please sign in to comment.