Skip to content

Add PostCSS plugin to fix relative @content and @plugin paths in @imported files #14063

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

Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
4cbf657
Add PostCSS plugin to fix relative `@content` and `@plugin` paths in …
philipp-spiess Jul 26, 2024
a04e2ba
Add invalid path examples
philipp-spiess Jul 26, 2024
74cee52
Run CI on Windows workers
philipp-spiess Jul 26, 2024
4a86bb5
Fix linter issue and append missing ;
philipp-spiess Jul 26, 2024
9721170
Disable fail-fast so that windows tests run through even when mac tes…
philipp-spiess Jul 26, 2024
81ee9c7
Only lint on linux
philipp-spiess Jul 26, 2024
9cdeed9
Revert changes that makes CI run on Windows (and mvoe it to #14065)
philipp-spiess Jul 26, 2024
68c5b16
Move plugin into a separate, private, package
philipp-spiess Jul 26, 2024
13f562e
Run new plugin for CLI and postcss clients
philipp-spiess Jul 26, 2024
e297bfe
Use over
philipp-spiess Jul 26, 2024
1162822
Fix relative paths that would have removed
philipp-spiess Jul 26, 2024
e5b330d
Fix vite integration by avoiding infinite loops and handling string c…
philipp-spiess Jul 29, 2024
70a96e6
Rename postcss plugin to internal-postcss-fix-relative-paths
philipp-spiess Jul 29, 2024
663181a
Clean up vite config callback
philipp-spiess Jul 29, 2024
e60d0b5
Add (failing) test for postcss client
philipp-spiess Jul 29, 2024
64175c5
Fix pnpm dependencies
philipp-spiess Jul 29, 2024
73111a5
Fix linter issues
philipp-spiess Jul 29, 2024
e474510
Fix issue with postcss client by converting to a visitor API and avoi…
philipp-spiess Jul 29, 2024
11bf660
Get rid of a few more const
philipp-spiess Jul 29, 2024
2c34553
Apply PR feedback
philipp-spiess Jul 29, 2024
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
Prev Previous commit
Next Next commit
Rename postcss plugin to internal-postcss-fix-relative-paths
  • Loading branch information
philipp-spiess committed Jul 29, 2024
commit 70a96e69b9a8f18df50bb4a9f073fd726cf12d8f
2 changes: 1 addition & 1 deletion packages/@tailwindcss-cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"postcss": "8.4.24",
"postcss-import": "^16.1.0",
"tailwindcss": "workspace:^",
"postcss-fix-relative-paths-plugin": "workspace:^"
"internal-postcss-fix-relative-paths": "workspace:^"
},
"devDependencies": {
"@types/postcss-import": "^14.0.3"
Expand Down
2 changes: 1 addition & 1 deletion packages/@tailwindcss-cli/src/commands/build/index.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import watcher from '@parcel/watcher'
import { IO, Parsing, scanDir, scanFiles, type ChangedContent } from '@tailwindcss/oxide'
import fixRelativePathsPlugin from 'internal-postcss-fix-relative-paths'
import { Features, transform } from 'lightningcss'
import { existsSync } from 'node:fs'
import fs from 'node:fs/promises'
import path from 'node:path'
import postcss from 'postcss'
import fixRelativePathsPlugin from 'postcss-fix-relative-paths-plugin'
import atImport from 'postcss-import'
import * as tailwindcss from 'tailwindcss'
import type { Arg, Result } from '../../utils/args'
Expand Down
2 changes: 1 addition & 1 deletion packages/@tailwindcss-cli/tsup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ export default defineConfig({
clean: true,
minify: true,
entry: ['src/index.ts'],
noExternal: ['postcss-fix-relative-paths-plugin'],
noExternal: ['internal-postcss-fix-relative-paths'],
})
2 changes: 1 addition & 1 deletion packages/@tailwindcss-postcss/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import path from 'path'
import postcss, { type AcceptedPlugin, type PluginCreator } from 'postcss'
import postcssImport from 'postcss-import'
import { compile } from 'tailwindcss'
import fixRelativePathsPlugin from '../../postcss-fix-relative-paths-plugin/src'
import fixRelativePathsPlugin from '../../internal-postcss-fix-relative-paths/src'

/**
* A Map that can generate default values for keys that don't exist.
Expand Down
2 changes: 1 addition & 1 deletion packages/@tailwindcss-postcss/tsup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ export default defineConfig({
cjsInterop: true,
dts: true,
entry: ['src/index.ts'],
noExternal: ['postcss-fix-relative-paths-plugin'],
noExternal: ['internal-postcss-fix-relative-paths'],
})
2 changes: 1 addition & 1 deletion packages/@tailwindcss-vite/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
},
"devDependencies": {
"@types/node": "^20.12.12",
"postcss-fix-relative-paths-plugin": "workspace:^",
"internal-postcss-fix-relative-paths": "workspace:^",
"vite": "^5.2.11"
},
"peerDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/@tailwindcss-vite/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { IO, Parsing, scanFiles } from '@tailwindcss/oxide'
import fixRelativePathsPlugin from 'internal-postcss-fix-relative-paths'
import { Features, transform } from 'lightningcss'
import path from 'path'
import fixRelativePathsPlugin from 'postcss-fix-relative-paths-plugin'
import postcssrc from 'postcss-load-config'
import { compile } from 'tailwindcss'
import type { Plugin, Rollup, Update, ViteDevServer } from 'vite'
Expand Down
2 changes: 1 addition & 1 deletion packages/@tailwindcss-vite/tsup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ export default defineConfig({
minify: true,
dts: true,
entry: ['src/index.ts'],
noExternal: ['postcss-fix-relative-paths-plugin'],
noExternal: ['internal-postcss-fix-relative-paths'],
})
Loading