@tailwindcss/postcss 4.0.0-alpha.15 → 4.0.0-alpha.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,11 @@
1
+ import { PluginCreator } from 'postcss';
2
+
3
+ type PluginOptions = {
4
+ base?: string;
5
+ optimize?: boolean | {
6
+ minify?: boolean;
7
+ };
8
+ };
9
+ declare const _default: PluginCreator<PluginOptions>;
10
+
11
+ export { _default as default };
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import postcss from 'postcss';
1
+ import { PluginCreator } from 'postcss';
2
2
 
3
3
  type PluginOptions = {
4
4
  base?: string;
@@ -6,6 +6,6 @@ type PluginOptions = {
6
6
  minify?: boolean;
7
7
  };
8
8
  };
9
- declare const _default: postcss.PluginCreator<PluginOptions>;
9
+ declare const _default: PluginCreator<PluginOptions>;
10
10
 
11
11
  export = _default;
package/dist/index.mjs ADDED
@@ -0,0 +1 @@
1
+ import{scanDir as T}from"@tailwindcss/oxide";import P from"fs";import{Features as b,transform as v}from"lightningcss";import z from"postcss";import C from"postcss-import";import{compile as M}from"tailwindcss";var g=class extends Map{constructor(t){super();this.factory=t}get(t){let l=super.get(t);return l===void 0&&(l=this.factory(t,this),this.set(t,l)),l}};function S(r={}){let p=r.base??process.cwd(),t=r.optimize??process.env.NODE_ENV==="production",l=new g(()=>({mtimes:new Map,build:null,css:"",optimizedCss:""}));return{postcssPlugin:"@tailwindcss/postcss",plugins:[C(),(a,n)=>{let c=n.opts.from??"",i=l.get(c),f="incremental";{let e=n.messages.flatMap(s=>s.type!=="dependency"?[]:s.file);e.push(c);for(let s of e){let d=P.statSync(s,{throwIfNoEntry:!1})?.mtimeMs??null;if(d===null){s===c&&(f="full");continue}i.mtimes.get(s)!==d&&(f="full",i.mtimes.set(s,d))}}let u=!1,m=!1;if(a.walkAtRules(e=>{if(e.name==="apply")u=!0;else if(e.name==="tailwind")return u=!0,m=!0,!1}),!m&&!u)return;let o="",{candidates:y,files:h,globs:w}=T({base:p,globs:!0});for(let e of h)n.messages.push({type:"dependency",plugin:"@tailwindcss/postcss",file:e,parent:n.opts.from});for(let{base:e,glob:s}of w)n.messages.push({type:"dir-dependency",plugin:"@tailwindcss/postcss",dir:e,glob:s,parent:n.opts.from});if(f==="full"){let{build:e}=M(a.toString());i.build=e,o=e(m?y:[])}else f==="incremental"&&(o=i.build(y));o!==i.css&&t&&(i.optimizedCss=V(o,{minify:typeof t=="object"?t.minify:!0})),i.css=o,a.removeAll(),a.append(z.parse(t?i.optimizedCss:i.css,n.opts))}]}}function V(r,{file:p="input.css",minify:t=!1}={}){return v({filename:p,code:Buffer.from(r),minify:t,sourceMap:!1,drafts:{customMedia:!0},nonStandard:{deepSelectorCombinator:!0},include:b.Nesting,exclude:b.LogicalProperties,targets:{safari:16<<16|1024},errorRecovery:!0}).code.toString()}var D=Object.assign(S,{postcss:!0});export{D as default};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tailwindcss/postcss",
3
- "version": "4.0.0-alpha.15",
3
+ "version": "4.0.0-alpha.17",
4
4
  "description": "PostCSS plugin for Tailwind CSS, a utility-first CSS framework for rapidly building custom user interfaces",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -20,23 +20,24 @@
20
20
  "exports": {
21
21
  ".": {
22
22
  "types": "./dist/index.d.ts",
23
+ "import": "./dist/index.mjs",
23
24
  "require": "./dist/index.js"
24
25
  }
25
26
  },
26
27
  "dependencies": {
27
- "lightningcss": "^1.24.0",
28
- "postcss-import": "^16.0.0",
29
- "@tailwindcss/oxide": "4.0.0-alpha.15",
30
- "tailwindcss": "4.0.0-alpha.15"
28
+ "lightningcss": "^1.25.1",
29
+ "postcss-import": "^16.1.0",
30
+ "@tailwindcss/oxide": "4.0.0-alpha.17",
31
+ "tailwindcss": "4.0.0-alpha.17"
31
32
  },
32
33
  "devDependencies": {
33
- "@types/node": "^20.11.17",
34
+ "@types/node": "^20.12.12",
34
35
  "@types/postcss-import": "^14.0.3",
35
36
  "postcss": "8.4.24"
36
37
  },
37
38
  "scripts": {
38
39
  "lint": "tsc --noEmit",
39
- "build": "tsup-node ./src/index.ts --format cjs --dts --cjsInterop --splitting --minify --clean",
40
+ "build": "tsup-node ./src/index.ts --format cjs,esm --dts --cjsInterop --splitting --minify --clean",
40
41
  "dev": "pnpm run build -- --watch"
41
42
  }
42
43
  }