@visulima/rollup-plugin-css 1.0.0-alpha.28 → 1.0.0-alpha.29
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.
- package/CHANGELOG.md +11 -0
- package/dist/loaders/tailwindcss-oxide.js +1 -1
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
## @visulima/rollup-plugin-css [1.0.0-alpha.29](https://github.com/visulima/packem/compare/@visulima/rollup-plugin-css@1.0.0-alpha.28...@visulima/rollup-plugin-css@1.0.0-alpha.29) (2026-04-16)
|
|
2
|
+
|
|
3
|
+
### Miscellaneous Chores
|
|
4
|
+
|
|
5
|
+
* bump node engines to ^22.14.0 || >=24.10.0 ([32f705a](https://github.com/visulima/packem/commit/32f705aa866f9daea6a094df74ef66aa8088e2c6))
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Dependencies
|
|
9
|
+
|
|
10
|
+
* **@visulima/packem-share:** upgraded to 1.0.0-alpha.30
|
|
11
|
+
|
|
1
12
|
## @visulima/rollup-plugin-css [1.0.0-alpha.28](https://github.com/visulima/packem/compare/@visulima/rollup-plugin-css@1.0.0-alpha.27...@visulima/rollup-plugin-css@1.0.0-alpha.28) (2026-03-28)
|
|
2
13
|
|
|
3
14
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
var A=Object.defineProperty;var y=(d,r)=>A(d,"name",{value:r,configurable:!0});import{stat as v}from"node:fs/promises";import{compile as M,Features as i,toSourceMap as P,optimize as x}from"@tailwindcss/node";import{clearRequireCache as z}from"@tailwindcss/node/require-cache";import{Scanner as $}from"@tailwindcss/oxide";import{findPackageJson as R}from"@visulima/package";import{resolve as w,dirname as C,relative as E,join as S,normalize as T}from"@visulima/path";import{resolveAlias as F}from"@visulima/path/utils";import{g as U}from"../packem_shared/generate-js-exports-BhS4eLrN.js";import{resolve as J}from"../packem_shared/resolve-anj9ucIq.js";var k=Object.defineProperty,f=y((d,r)=>k(d,"name",{value:r,configurable:!0}),"m");class j{static{y(this,"U")}constructor(r,o,g,l,h,t){this.id=r,this.base=o,this.enableSourceMaps=g,this.customCssResolver=l,this.customJsResolver=h,this.logger=t}id;base;enableSourceMaps;customCssResolver;customJsResolver;logger;static{f(this,"TailwindRoot")}compiler;scanner;candidates=new Set;buildDependencies=new Map;async generate(r,o){const g=w(this.id.replace(/\?.*$/u,"")),l=f(e=>{e!==g&&(/[#?].*\.svg$/u.test(e)||o(e))},"addWatchFileWrapper"),h=this.requiresBuild(),t=C(w(g));if(!this.compiler||!this.scanner||await h){z([...this.buildDependencies.keys()]),this.buildDependencies.clear(),this.addBuildDependency(g),this.logger.debug({message:"Setup compiler"});const e=[];this.compiler=await M(r,{base:t,customCssResolver:this.customCssResolver,customJsResolver:this.customJsResolver,from:this.enableSourceMaps?this.id:void 0,onDependency:f(m=>{l(m),e.push(this.addBuildDependency(m))},"onDependency"),shouldRewriteUrls:!0}),await Promise.all(e),this.logger.debug({message:"Setup scanner"});const a=[...this.compiler.root==="none"?[]:this.compiler.root===null?[{base:this.base,negated:!1,pattern:"**/*"}]:[{...this.compiler.root,negated:!1}],...this.compiler.sources];this.scanner=new $({sources:a})}else for(const e of this.buildDependencies.keys())l(e);const c=this.compiler.features&(i.AtApply|i.JsPluginCompat|i.ThemeFunction|i.Utilities);if(this.logger.debug({data:{availableFeatures:this.compiler.features,hasAtApply:!!(this.compiler.features&i.AtApply),hasJsPluginCompat:!!(this.compiler.features&i.JsPluginCompat),hasRequiredFeatures:!!c,hasThemeFunction:!!(this.compiler.features&i.ThemeFunction),hasUtilities:!!(this.compiler.features&i.Utilities),requiredFeatures:i.AtApply|i.JsPluginCompat|i.ThemeFunction|i.Utilities},message:"Feature analysis"}),!c)return this.logger.debug({data:{missingFeatures:{AtApply:!(this.compiler.features&i.AtApply),JsPluginCompat:!(this.compiler.features&i.JsPluginCompat),ThemeFunction:!(this.compiler.features&i.ThemeFunction),Utilities:!(this.compiler.features&i.Utilities)}},message:"Missing required features, returning false"}),!1;if(this.compiler.features&i.Utilities)if(this.logger.debug({data:{candidatesCountBefore:this.candidates.size,scannerExists:!!this.scanner,scannerHasScan:!!(this.scanner&&typeof this.scanner.scan=="function")},message:"Scan for candidates - Utilities feature enabled"}),this.scanner){const e=this.scanner.scan();this.logger.debug({data:{scannedCandidates:e.slice(0,10),scannedCandidatesCount:e.length},message:"Scanner results"});for(const a of e)this.candidates.add(a);this.logger.debug({data:{candidatesCountAfter:this.candidates.size,newCandidatesAdded:e.length},message:"Candidates updated"})}else this.logger.debug({data:{hasScanMethod:!!(this.scanner&&typeof this.scanner.scan=="function"),scannerType:typeof this.scanner},message:"Scanner not available or missing scan method"});else this.logger.debug({message:"Utilities feature not enabled, skipping candidate scanning"});if(this.compiler.features&i.Utilities){if(this.scanner&&this.scanner.files){this.logger.debug({data:{files:this.scanner.files.slice(0,5),filesCount:this.scanner.files.length},message:"Watching individual files from scanner"});for(const e of this.scanner.files)l(e)}else this.logger.debug({message:"No individual files to watch from scanner"});if(this.scanner&&this.scanner.globs){this.logger.debug({data:{globs:this.scanner.globs.slice(0,3),globsCount:this.scanner.globs.length},message:"Processing globs from scanner"});for await(const e of this.scanner.globs){if(e.pattern[0]==="!"){this.logger.debug({data:{pattern:e.pattern},message:"Skipping negated glob pattern"});continue}let a=E(this.base,e.base);a[0]!=="."&&(a=`./${a}`);const m=S(a,e.pattern);this.logger.debug({data:{base:e.base,glob:e.pattern,watchPath:m},message:"Adding glob to watch list"}),l(m);const{root:b}=this.compiler;if(b!=="none"&&b!==null){const p=w(b.base,b.pattern);try{const u=await v(p);if(u.isDirectory())this.logger.debug({data:{basePath:p,isDirectory:u.isDirectory()},message:"Valid source directory confirmed"});else{const D=`The path given to \`source(…)\` must be a directory but got \`source(${p})\` instead.`;throw this.logger.debug({data:{basePath:p,error:D,isDirectory:u.isDirectory()},message:"Invalid source path detected"}),new Error(D)}}catch(u){this.logger.debug({data:{basePath:p,error:u instanceof Error?u.message:String(u)},message:"Error checking source directory"})}}}}else this.logger.debug({message:"No globs to process from scanner"})}else this.logger.debug({message:"Utilities feature not enabled, skipping file watching"});this.logger.debug({data:{candidates:[...this.candidates].slice(0,10),candidatesCount:this.candidates.size},message:"Build CSS"});const s=this.compiler.build([...this.candidates]);this.logger.debug({data:{cssLength:s.length,cssPreview:s.slice(0,200)+(s.length>200?"...":"")},message:"CSS build completed"}),this.logger.debug({data:{enableSourceMaps:this.enableSourceMaps},message:"Build Source Map"});const n=(this.enableSourceMaps?P(this.compiler.buildSourceMap()):void 0)?.raw;if(n){const e=n;this.logger.debug({data:{hasMappings:!!e.mappings,mapSize:JSON.stringify(n).length,sourcesCount:e.sources?.length||0},message:"Source map generated"})}else this.logger.debug({message:"No source map generated"});return{code:s,map:n}}async addBuildDependency(r){let o;try{o=(await v(r)).mtimeMs}catch{}this.buildDependencies.set(r,o)}async requiresBuild(){for await(const[r,o]of this.buildDependencies){if(o===void 0)return!0;try{if((await v(r)).mtimeMs>o)return!0}catch{return!0}}return!1}}const V={name:"tailwindcss",async process({code:d,map:r}){const o=this.alias,g=f(async(s,n)=>{try{const e=await R(n),a=J([s,F(s,o??{})],{baseDirs:[n,S(C(e.path),"node_modules")],caller:"Tailwind CSS Resolver",conditionNames:["style","development|production"],extensions:[".css"],mainFields:["style"],preferRelative:!0});if(a)return this.logger.debug({message:`Resolved CSS import: ${s} -> ${a}`}),a}catch{}return this.logger.debug({message:`Failed to resolve CSS import: ${s} from ${n}`}),!1},"customCssResolver"),l=f(async(s,n)=>{try{const e=await R(n),a=J([s,F(s,o??{})],{baseDirs:[n,S(C(e.path),"node_modules")],caller:"Tailwind JS Resolver",extensions:[".js",".mjs",".cjs",".ts",".tsx",".jsx"]});if(a)return this.logger.debug({message:`Resolved JS import: ${s} -> ${a}`}),a}catch{}return this.logger.debug({message:`Failed to resolve JS import: ${s} from ${n}`}),!1},"customJsResolver"),h=this.cwd?this.sourceDir?S(this.cwd,this.sourceDir):this.cwd:this.sourceDir||process.cwd();let t=await new j(this.id,h,this.useSourcemap,g,l,this.logger).generate(d,s=>this.deps.add(T(s)));if(!t)return this.logger.debug({data:{returningOriginalContent:!0},message:"Tailwind generation returned false - not a Tailwind file or missing features"}),{code:d,map:r};if(this.logger.debug({message:"[@tailwindcss/rollup] Generate CSS"}),this.environment==="production"){this.logger.debug({data:{minify:!0,originalSize:t.code.length},message:"[@tailwindcss/rollup] Optimize CSS"});const s=x(t.code,{file:this.id,map:t.map,minify:!0});this.logger.debug({data:{optimizedSize:s.code.length,originalSize:t.code.length,sizeReduction:t.code.length-s.code.length,sizeReductionPercent:`${((t.code.length-s.code.length)/t.code.length*100).toFixed(2)}%`},message:"CSS optimization completed"}),t=s}else this.logger.debug({data:{environment:this.environment},message:"Development mode - skipping CSS optimization"});if(this.emit)return{...t,meta:{moduleContents:t,types:void 0},moduleSideEffects:!0};const c=U({css:t.code,cwd:this.cwd,dts:this.dts,emit:this.emit,extract:this.extract,icssDependencies:[],id:this.id,inject:this.inject,inline:this.inline,logger:this.logger,map:t.map,modulesExports:{},namedExports:this.namedExports,supportModules:!1});return this.extract?{code:c.code,extracted:{css:t.code,id:this.id,map:t.map},map:c.map,meta:c.meta,moduleSideEffects:c.moduleSideEffects}:{code:c.code,map:c.map,meta:c.meta,moduleSideEffects:c.moduleSideEffects}},test:/\.css$/i};export{V as default};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@visulima/rollup-plugin-css",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.29",
|
|
4
4
|
"description": "CSS processing plugin for packem",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"visulima",
|
|
@@ -99,11 +99,11 @@
|
|
|
99
99
|
"@rollup/pluginutils": "5.3.0",
|
|
100
100
|
"@visulima/fs": "4.1.0",
|
|
101
101
|
"@visulima/package": "4.1.7",
|
|
102
|
-
"@visulima/packem-share": "1.0.0-alpha.
|
|
102
|
+
"@visulima/packem-share": "1.0.0-alpha.30",
|
|
103
103
|
"@visulima/path": "2.0.5",
|
|
104
104
|
"mlly": "1.8.2",
|
|
105
105
|
"oxc-resolver": "11.19.1",
|
|
106
|
-
"p-queue": "9.1.
|
|
106
|
+
"p-queue": "9.1.2",
|
|
107
107
|
"source-map-js": "^1.2.1"
|
|
108
108
|
},
|
|
109
109
|
"peerDependencies": {
|
|
@@ -207,7 +207,7 @@
|
|
|
207
207
|
}
|
|
208
208
|
},
|
|
209
209
|
"engines": {
|
|
210
|
-
"node": ">=
|
|
210
|
+
"node": "^22.14.0 || >= 24.10.0"
|
|
211
211
|
},
|
|
212
212
|
"publishConfig": {
|
|
213
213
|
"access": "public",
|