@visulima/rollup-plugin-css 1.0.0-alpha.1 → 1.0.0-alpha.11
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 +108 -0
- package/LICENSE.md +83 -79
- package/README.md +349 -109
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -0
- package/dist/loaders/less/index.d.ts +17 -9
- package/dist/loaders/less/index.js +1 -0
- package/dist/loaders/lightningcss.d.ts +2 -2
- package/dist/loaders/lightningcss.js +3 -0
- package/dist/loaders/postcss/index.d.ts +2 -2
- package/dist/loaders/postcss/{index.mjs → index.js} +1 -1
- package/dist/loaders/sass/index.d.ts +18 -9
- package/dist/loaders/sass/{index.mjs → index.js} +1 -1
- package/dist/loaders/sourcemap.d.ts +2 -2
- package/dist/loaders/sourcemap.js +1 -0
- package/dist/loaders/stylus/index.d.ts +17 -9
- package/dist/loaders/stylus/index.js +1 -0
- package/dist/loaders/tailwindcss-oxide.d.ts +2 -2
- package/dist/loaders/tailwindcss-oxide.js +1 -0
- package/dist/minifiers/cssnano.d.ts +2 -2
- package/dist/minifiers/lightningcss.d.ts +2 -2
- package/dist/packem_shared/concat-BnU-BO62.js +3 -0
- package/dist/packem_shared/{cssModulesTypesPlugin-B9_bJo_B.mjs → cssModulesTypesPlugin-CjGroK2y.js} +1 -1
- package/dist/packem_shared/generate-js-exports-BhS4eLrN.js +23 -0
- package/dist/packem_shared/getMap-CxaNZNeI.js +1 -0
- package/dist/packem_shared/inferModeOption-9h3Eq6JH.js +1 -0
- package/dist/packem_shared/loadModule-D20jQQNu.js +1 -0
- package/dist/packem_shared/resolve-anj9ucIq.js +1 -0
- package/dist/packem_shared/rollupCssPlugin-CChaHsU3.js +3 -0
- package/dist/packem_shared/{types-BS4hXME3.d.mts → types-CA9pSumu.d.ts} +5 -1
- package/dist/utils/index.d.ts +4 -2
- package/dist/utils/index.js +1 -0
- package/package.json +56 -41
- package/dist/index.d.mts +0 -20
- package/dist/index.mjs +0 -1
- package/dist/loaders/less/index.d.mts +0 -17
- package/dist/loaders/less/index.mjs +0 -1
- package/dist/loaders/lightningcss.d.mts +0 -17
- package/dist/loaders/lightningcss.mjs +0 -3
- package/dist/loaders/postcss/index.d.mts +0 -17
- package/dist/loaders/sass/index.d.mts +0 -18
- package/dist/loaders/sourcemap.d.mts +0 -17
- package/dist/loaders/sourcemap.mjs +0 -1
- package/dist/loaders/stylus/index.d.mts +0 -17
- package/dist/loaders/stylus/index.mjs +0 -1
- package/dist/loaders/tailwindcss-oxide.d.mts +0 -17
- package/dist/loaders/tailwindcss-oxide.mjs +0 -1
- package/dist/minifiers/cssnano.d.mts +0 -17
- package/dist/minifiers/lightningcss.d.mts +0 -17
- package/dist/packem_shared/concat-BbvpVPBg.mjs +0 -3
- package/dist/packem_shared/generate-js-exports-Cg7EXFF1.mjs +0 -14
- package/dist/packem_shared/getMap-BL5hKEnR.mjs +0 -1
- package/dist/packem_shared/inferModeOption-DYyLMRb2.mjs +0 -1
- package/dist/packem_shared/loadModule-CovDETwT.mjs +0 -1
- package/dist/packem_shared/resolve-nqhcPNJ9.mjs +0 -1
- package/dist/packem_shared/rollupCssPlugin-D-7azn92.mjs +0 -3
- package/dist/packem_shared/types-BS4hXME3.d.ts +0 -185
- package/dist/utils/index.d.mts +0 -71
- package/dist/utils/index.mjs +0 -1
- /package/dist/minifiers/{cssnano.mjs → cssnano.js} +0 -0
- /package/dist/minifiers/{lightningcss.mjs → lightningcss.js} +0 -0
- /package/dist/packem_shared/{arrayFmt-Dek5cB7m.mjs → arrayFmt-Dek5cB7m.js} +0 -0
- /package/dist/packem_shared/{ensure-auto-modules-BU3xWEjl.mjs → ensure-auto-modules-BU3xWEjl.js} +0 -0
- /package/dist/packem_shared/{hasModuleSpecifier-DIZeev_W.mjs → hasModuleSpecifier-DIZeev_W.js} +0 -0
- /package/dist/packem_shared/{safeId-BN5akJYJ.mjs → safeId-BN5akJYJ.js} +0 -0
- /package/dist/packem_shared/{sourcemap-DGfgaUBb.mjs → sourcemap-DGfgaUBb.js} +0 -0
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { c as Loader, L as LightningCSSOptions } from '../packem_shared/types-BS4hXME3.mjs';
|
|
2
|
-
import 'cssnano';
|
|
3
|
-
import 'lightningcss';
|
|
4
|
-
import 'postcss';
|
|
5
|
-
import 'postcss-load-config';
|
|
6
|
-
import 'less';
|
|
7
|
-
import '@visulima/packem-share/types';
|
|
8
|
-
import 'sass';
|
|
9
|
-
import 'sass-embedded';
|
|
10
|
-
import 'stylus';
|
|
11
|
-
import '@visulima/packem-share/utils';
|
|
12
|
-
import 'rollup';
|
|
13
|
-
import 'source-map-js';
|
|
14
|
-
|
|
15
|
-
declare const lightningCSSLoader: Loader<LightningCSSOptions>;
|
|
16
|
-
|
|
17
|
-
export { lightningCSSLoader as default };
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{transform as r,browserslistToTargets as a}from"lightningcss";import{n as o}from"../packem_shared/ensure-auto-modules-BU3xWEjl.mjs";const l={name:"lightningCSS",async process({code:t,map:i}){let s=!1;typeof this.options.modules=="boolean"?s=this.options.modules:typeof this.options.modules=="object"&&(s=o(this.options.modules.include,this.id)),this.autoModules&&this.options.modules===void 0&&(s=o(this.autoModules,this.id));const e=r({...this.options,code:Buffer.from(t),cssModules:this.options.modules??s,filename:this.id,inputSourceMap:i,minify:!1,sourceMap:!this.sourceMap,targets:a(this.browserTargets)});return e.warnings.length>0&&this.logger.warn({message:`warnings when transforming css:
|
|
2
|
-
${e.warnings.map(n=>n.message).join(`
|
|
3
|
-
`)}`}),{code:e.code.toString(),map:e.map?JSON.parse(Buffer.from(e.map).toString()):void 0,moduleSideEffects:s||typeof this.inject=="object"&&this.inject.treeshakeable?!1:"no-treeshake"}},test:/\.css$/i};export{l as default};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { c as Loader, a as InternalStyleOptions } from '../../packem_shared/types-BS4hXME3.mjs';
|
|
2
|
-
import 'cssnano';
|
|
3
|
-
import 'lightningcss';
|
|
4
|
-
import 'postcss';
|
|
5
|
-
import 'postcss-load-config';
|
|
6
|
-
import 'less';
|
|
7
|
-
import '@visulima/packem-share/types';
|
|
8
|
-
import 'sass';
|
|
9
|
-
import 'sass-embedded';
|
|
10
|
-
import 'stylus';
|
|
11
|
-
import '@visulima/packem-share/utils';
|
|
12
|
-
import 'rollup';
|
|
13
|
-
import 'source-map-js';
|
|
14
|
-
|
|
15
|
-
declare const loader: Loader<NonNullable<InternalStyleOptions["postcss"]>>;
|
|
16
|
-
|
|
17
|
-
export { loader as default };
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { c as Loader, e as SassLoaderOptions } from '../../packem_shared/types-BS4hXME3.mjs';
|
|
2
|
-
export { f as SassLoaderContext } from '../../packem_shared/types-BS4hXME3.mjs';
|
|
3
|
-
import 'cssnano';
|
|
4
|
-
import 'lightningcss';
|
|
5
|
-
import 'postcss';
|
|
6
|
-
import 'postcss-load-config';
|
|
7
|
-
import 'less';
|
|
8
|
-
import '@visulima/packem-share/types';
|
|
9
|
-
import 'sass';
|
|
10
|
-
import 'sass-embedded';
|
|
11
|
-
import 'stylus';
|
|
12
|
-
import '@visulima/packem-share/utils';
|
|
13
|
-
import 'rollup';
|
|
14
|
-
import 'source-map-js';
|
|
15
|
-
|
|
16
|
-
declare const loader: Loader<SassLoaderOptions>;
|
|
17
|
-
|
|
18
|
-
export { SassLoaderOptions, loader as default };
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { c as Loader } from '../packem_shared/types-BS4hXME3.mjs';
|
|
2
|
-
import 'cssnano';
|
|
3
|
-
import 'lightningcss';
|
|
4
|
-
import 'postcss';
|
|
5
|
-
import 'postcss-load-config';
|
|
6
|
-
import 'less';
|
|
7
|
-
import '@visulima/packem-share/types';
|
|
8
|
-
import 'sass';
|
|
9
|
-
import 'sass-embedded';
|
|
10
|
-
import 'stylus';
|
|
11
|
-
import '@visulima/packem-share/utils';
|
|
12
|
-
import 'rollup';
|
|
13
|
-
import 'source-map-js';
|
|
14
|
-
|
|
15
|
-
declare const loader: Loader;
|
|
16
|
-
|
|
17
|
-
export { loader as default };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{g as e,s as o}from"../packem_shared/sourcemap-DGfgaUBb.mjs";const p={alwaysProcess:!0,name:"sourcemap",async process({code:a,map:s}){return{code:o(a),map:await e(a,this.id)??s}}};export{p as default};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { c as Loader, g as StylusLoaderOptions } from '../../packem_shared/types-BS4hXME3.mjs';
|
|
2
|
-
import 'cssnano';
|
|
3
|
-
import 'lightningcss';
|
|
4
|
-
import 'postcss';
|
|
5
|
-
import 'postcss-load-config';
|
|
6
|
-
import 'less';
|
|
7
|
-
import '@visulima/packem-share/types';
|
|
8
|
-
import 'sass';
|
|
9
|
-
import 'sass-embedded';
|
|
10
|
-
import 'stylus';
|
|
11
|
-
import '@visulima/packem-share/utils';
|
|
12
|
-
import 'rollup';
|
|
13
|
-
import 'source-map-js';
|
|
14
|
-
|
|
15
|
-
declare const loader: Loader<StylusLoaderOptions>;
|
|
16
|
-
|
|
17
|
-
export { StylusLoaderOptions, loader as default };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var h=Object.defineProperty;var p=(e,t)=>h(e,"name",{value:t,configurable:!0});import{existsSync as y}from"node:fs";import{readFileSync as w}from"@visulima/fs";import{normalize as n,dirname as P,join as m}from"@visulima/path";import S from"stylus";import{m as b}from"../../packem_shared/sourcemap-DGfgaUBb.mjs";var v=Object.defineProperty,u=p((e,t)=>v(e,"name",{value:t,configurable:!0}),"a");const C=u(async(e,t)=>{if(!(!e.sources||e.sourcesContent))return await Promise.all(e.sources.map(async r=>{const o=n(m(t,r));if(y(o))return w(o)}).filter(Boolean))},"populateSourcemapContent"),F={name:"stylus",async process({code:e,map:t}){const r={...this.options},o=n(P(this.id)),i=[o,m(o,"node_modules"),m(this.cwd,"node_modules")];r.paths&&i.push(...r.paths);const s=S(e,r).set("filename",this.id).set("paths",i).set("sourcemap",{basePath:o,comment:!1});e=await u(async()=>await new Promise((a,l)=>{s.render((c,f)=>c?l(c):a(f))}),"render")();const d=s.deps();for(const a of d)this.deps.add(n(a));return s.sourcemap&&(s.sourcemap.sourcesContent=await C(s.sourcemap,o)),{code:e,map:b(s.sourcemap).toString()??t}},test:/\.(styl|stylus)$/i};export{F as default};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { c as Loader } from '../packem_shared/types-BS4hXME3.mjs';
|
|
2
|
-
import 'cssnano';
|
|
3
|
-
import 'lightningcss';
|
|
4
|
-
import 'postcss';
|
|
5
|
-
import 'postcss-load-config';
|
|
6
|
-
import 'less';
|
|
7
|
-
import '@visulima/packem-share/types';
|
|
8
|
-
import 'sass';
|
|
9
|
-
import 'sass-embedded';
|
|
10
|
-
import 'stylus';
|
|
11
|
-
import '@visulima/packem-share/utils';
|
|
12
|
-
import 'rollup';
|
|
13
|
-
import 'source-map-js';
|
|
14
|
-
|
|
15
|
-
declare const tailwindcssLoader: Loader;
|
|
16
|
-
|
|
17
|
-
export { tailwindcssLoader as default };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var J=Object.defineProperty;var S=(g,a)=>J(g,"name",{value:a,configurable:!0});import{stat as y}from"node:fs/promises";import{compile as P,Features as i,toSourceMap as x,optimize as z}from"@tailwindcss/node";import{clearRequireCache as M}from"@tailwindcss/node/require-cache";import{Scanner as $}from"@tailwindcss/oxide";import{findPackageJson as R}from"@visulima/package";import{resolve as v,dirname as w,relative as E,join as C,normalize as T}from"@visulima/path";import{resolveAlias as F}from"@visulima/path/utils";import{g as U}from"../packem_shared/generate-js-exports-Cg7EXFF1.mjs";import{resolve as A}from"../packem_shared/resolve-nqhcPNJ9.mjs";var k=Object.defineProperty,f=S((g,a)=>k(g,"name",{value:a,configurable:!0}),"p");class B{static{S(this,"U")}constructor(a,r,u,l,s,n){this.id=a,this.base=r,this.enableSourceMaps=u,this.customCssResolver=l,this.customJsResolver=s,this.logger=n}static{f(this,"TailwindRoot")}compiler;scanner;candidates=new Set;buildDependencies=new Map;async generate(a,r){const u=v(this.id.replace(/\?.*$/u,"")),l=f(e=>{e!==u&&(/[#?].*\.svg$/u.test(e)||r(e))},"addWatchFileWrapper"),s=this.requiresBuild(),n=w(v(u));if(!this.compiler||!this.scanner||await s){M([...this.buildDependencies.keys()]),this.buildDependencies.clear(),this.addBuildDependency(u),this.logger.debug({message:"Setup compiler"});const e=[];this.compiler=await P(a,{base:n,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 d=[...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:d})}else for(const e of this.buildDependencies.keys())l(e);const t=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:!!t,hasThemeFunction:!!(this.compiler.features&i.ThemeFunction),hasUtilities:!!(this.compiler.features&i.Utilities),requiredFeatures:i.AtApply|i.JsPluginCompat|i.ThemeFunction|i.Utilities},message:"Feature analysis"}),!t)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 d of e)this.candidates.add(d);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 d=E(this.base,e.base);d[0]!=="."&&(d=`./${d}`);const m=C(d,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=v(b.base,b.pattern);try{const h=await y(p);if(h.isDirectory())this.logger.debug({data:{basePath:p,isDirectory:h.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:h.isDirectory()},message:"Invalid source path detected"}),new Error(D)}}catch(h){this.logger.debug({data:{basePath:p,error:h instanceof Error?h.message:String(h)},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 o=this.compiler.build([...this.candidates]);this.logger.debug({data:{cssLength:o.length,cssPreview:o.slice(0,200)+(o.length>200?"...":"")},message:"CSS build completed"}),this.logger.debug({data:{enableSourceMaps:this.enableSourceMaps},message:"Build Source Map"});const c=(this.enableSourceMaps?x(this.compiler.buildSourceMap()):void 0)?.raw;return c?this.logger.debug({data:{hasMappings:!!c.mappings,mapSize:JSON.stringify(c).length,sourcesCount:c.sources?.length||0},message:"Source map generated"}):this.logger.debug({message:"No source map generated"}),{code:o,map:c}}async addBuildDependency(a){let r;try{r=(await y(a)).mtimeMs}catch{}this.buildDependencies.set(a,r)}async requiresBuild(){for await(const[a,r]of this.buildDependencies){if(r===void 0)return!0;try{if((await y(a)).mtimeMs>r)return!0}catch{return!0}}return!1}}const V={name:"tailwindcss",async process({code:g,map:a}){const r=this.alias,u=f(async(t,o)=>{try{const c=await R(o),e=A([t,F(t,r??{})],{baseDirs:[o,C(w(c.path),"node_modules")],caller:"Tailwind CSS Resolver",conditionNames:["style","development|production"],extensions:[".css"],mainFields:["style"],preferRelative:!0});if(e)return this.logger.debug({message:`Resolved CSS import: ${t} -> ${e}`}),e}catch{}return this.logger.debug({message:`Failed to resolve CSS import: ${t} from ${o}`}),!1},"customCssResolver"),l=f(async(t,o)=>{try{const c=await R(o),e=A([t,F(t,r??{})],{baseDirs:[o,C(w(c.path),"node_modules")],caller:"Tailwind JS Resolver",extensions:[".js",".mjs",".cjs",".ts",".tsx",".jsx"]});if(e)return this.logger.debug({message:`Resolved JS import: ${t} -> ${e}`}),e}catch{}return this.logger.debug({message:`Failed to resolve JS import: ${t} from ${o}`}),!1},"customJsResolver");let s=await new B(this.id,this.sourceDir||process.cwd(),this.useSourcemap,u,l,this.logger).generate(g,t=>this.deps.add(T(t)));if(!s)return this.logger.debug({data:{returningOriginalContent:!0},message:"Tailwind generation returned false - not a Tailwind file or missing features"}),{code:g,map:a};if(this.logger.debug({message:"[@tailwindcss/rollup] Generate CSS"}),this.environment==="production"){this.logger.debug({data:{minify:!0,originalSize:s.code.length},message:"[@tailwindcss/rollup] Optimize CSS"});const t=z(s.code,{file:this.id,map:s.map,minify:!0});this.logger.debug({data:{optimizedSize:t.code.length,originalSize:s.code.length,sizeReduction:s.code.length-t.code.length,sizeReductionPercent:`${((s.code.length-t.code.length)/s.code.length*100).toFixed(2)}%`},message:"CSS optimization completed"}),s=t}else this.logger.debug({data:{environment:this.environment},message:"Development mode - skipping CSS optimization"});if(this.emit)return{...s,meta:{moduleContents:s,types:void 0},moduleSideEffects:!0};const n=U({css:s.code,cwd:this.cwd,dts:this.dts,emit:this.emit,extract:this.extract,icssDependencies:[],id:this.id,inject:this.inject,logger:this.logger,map:s.map,modulesExports:{},namedExports:this.namedExports,supportModules:!1});return this.extract?{code:n.code,extracted:{css:s.code,id:this.id,map:s.map},map:n.map,meta:n.meta,moduleSideEffects:n.moduleSideEffects}:{code:n.code,map:n.map,meta:n.meta,moduleSideEffects:n.moduleSideEffects}},test:/\.css$/i};export{V as default};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { Options } from 'cssnano';
|
|
2
|
-
import { M as Minifier } from '../packem_shared/types-BS4hXME3.mjs';
|
|
3
|
-
import 'lightningcss';
|
|
4
|
-
import 'postcss';
|
|
5
|
-
import 'postcss-load-config';
|
|
6
|
-
import 'less';
|
|
7
|
-
import '@visulima/packem-share/types';
|
|
8
|
-
import 'sass';
|
|
9
|
-
import 'sass-embedded';
|
|
10
|
-
import 'stylus';
|
|
11
|
-
import '@visulima/packem-share/utils';
|
|
12
|
-
import 'rollup';
|
|
13
|
-
import 'source-map-js';
|
|
14
|
-
|
|
15
|
-
declare const cssnanoMinifier: Minifier<Options>;
|
|
16
|
-
|
|
17
|
-
export { cssnanoMinifier as default };
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { M as Minifier, a as InternalStyleOptions } from '../packem_shared/types-BS4hXME3.mjs';
|
|
2
|
-
import 'cssnano';
|
|
3
|
-
import 'lightningcss';
|
|
4
|
-
import 'postcss';
|
|
5
|
-
import 'postcss-load-config';
|
|
6
|
-
import 'less';
|
|
7
|
-
import '@visulima/packem-share/types';
|
|
8
|
-
import 'sass';
|
|
9
|
-
import 'sass-embedded';
|
|
10
|
-
import 'stylus';
|
|
11
|
-
import '@visulima/packem-share/utils';
|
|
12
|
-
import 'rollup';
|
|
13
|
-
import 'source-map-js';
|
|
14
|
-
|
|
15
|
-
declare const lightningcssMinifier: Minifier<NonNullable<InternalStyleOptions["lightningcss"]>>;
|
|
16
|
-
|
|
17
|
-
export { lightningcssMinifier as default };
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
var l=Object.defineProperty;var u=(o,n)=>l(o,"name",{value:n,configurable:!0});import{SourceMapGenerator as p}from"source-map-js";import{m as f}from"./sourcemap-DGfgaUBb.mjs";var g=Object.defineProperty,d=u((o,n)=>g(o,"name",{value:n,configurable:!0}),"u");const j=d(async o=>{const n=new p({file:""}),a=[];let c=0;for await(const{css:i,map:m}of o){a.push(i);const s=f(m),t=s.toObject();if(!t)continue;const r=s.toConsumer();if(r){if(r.eachMapping(e=>{n.addMapping({generated:{column:e.generatedColumn,line:c+e.generatedLine},name:e.name,original:{column:e.originalColumn,line:e.originalLine},source:e.source})}),t.sourcesContent)for(const e of t.sources)n.setSourceContent(e,r.sourceContentFor(e,!0));c+=i.split(`
|
|
2
|
-
`).length}}return{css:a.join(`
|
|
3
|
-
`),map:n}},"concat");export{j as default};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
var z=Object.defineProperty;var k=(r,s)=>z(r,"name",{value:s,configurable:!0});import{basename as A,relative as _}from"@visulima/path";import P from"./safeId-BN5akJYJ.mjs";var R=Object.defineProperty,v=k((r,s)=>R(r,"name",{value:s,configurable:!0}),"$");const c="css",q=new Set(["abstract","arguments","await","boolean","break","byte","case","catch","char","class","const","continue",c,"debugger","default","delete","do","double","else","enum","eval","export","extends","false","final","finally","float","for","function","goto","if","implements","import","in","instanceof","int","interface","let","long","native","new","null","package","private","protected","public","return","short","static","super","switch","synchronized","this","throw","throws","transient","true","try","typeof","var","void","volatile","while","with","yield"]),F=v(r=>{const s=r.replaceAll(/[^\w$]/g,"_");return q.has(s)?`_${s}`:s},"getClassNameDefault"),L=v(({css:r,cwd:s,dts:$=!1,emit:N=!1,extract:D=!1,icssDependencies:b=[],id:l,inject:o,logger:w,map:g,modulesExports:n,namedExports:m,supportModules:y})=>{const x=v(t=>P(t,A(l)),"saferId"),f=x("modules"),e=[`var ${c} = ${JSON.stringify(r)};`],a=[],S=[c];if(m){$&&a.push(`declare const ${c}: string;`);const t=typeof m=="function"?m:F;for(const[p,h]of Object.entries(n)){const i=t(p);if(p!==i&&w){const d=s?_(s,l):l;w.warn({message:`Exported \`${p}\` as \`${i}\` in ${d}`})}const u=JSON.stringify(h);e.push(`var ${i} = ${u};`),$&&a.push(`declare const ${i}: ${u};`),S.push(i)}}if(o)if(typeof o=="function")e.push(o(c,l,e),`var ${f} = ${JSON.stringify(n)};`);else{const{treeshakeable:t,...p}=typeof o=="object"?o:{},h=x("injector"),i=`${h}(${c},${JSON.stringify(p)});`;if(e.unshift(`import { cssStyleInject as ${h} } from "@visulima/css-style-inject";`),t||e.push(`var ${f} = ${JSON.stringify(n)};`,i),t){e.push("var injected = false;");const u=`if (!injected) { injected = true; ${i} }`;if(n.inject)throw new Error("`inject` keyword is reserved when using `inject.treeshakeable` option");let d="";for(const[B,C]of Object.entries(n)){const M=JSON.stringify(B),I=JSON.stringify(C);d+=`get ${M}() { ${u} return ${I}; },
|
|
2
|
-
`}d+=`inject: function inject() { ${u} },`,e.push(`var ${f} = {${d}};`)}}!o&&Object.keys(n).length>0&&e.push(`var ${f} = ${JSON.stringify(n)};`);const O=`
|
|
3
|
-
export default ${y?f:c};
|
|
4
|
-
`;if(e.push(O),$&&(y&&a.push(`
|
|
5
|
-
interface ModulesExports {
|
|
6
|
-
${Object.keys(n).map(t=>` '${t}': string;`).join(`
|
|
7
|
-
`)}
|
|
8
|
-
}
|
|
9
|
-
`,typeof o=="object"&&o.treeshakeable?"interface ModulesExports {inject:()=>void}":"",`declare const ${f}: ModulesExports;`),a.push(O)),m){const t=`export {
|
|
10
|
-
${S.filter(Boolean).join(`,
|
|
11
|
-
`)}
|
|
12
|
-
};`;e.push(t),$&&a.push(t)}const j=e.filter(Boolean).join(`
|
|
13
|
-
`),E=a.length>0?a.filter(Boolean).join(`
|
|
14
|
-
`):void 0;if(N)return{code:r,map:g,meta:{icssDependencies:b,moduleContents:j,types:void 0},moduleSideEffects:!0};let J;return D&&(J={css:r,id:l,map:g}),{code:j,extracted:J,map:g,meta:{icssDependencies:b,moduleContents:j,types:E},moduleSideEffects:y||typeof o=="object"&&o.treeshakeable?!1:"no-treeshake",types:E}},"generateJsExports");export{L as g};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"@visulima/fs";import"@visulima/path";import"source-map-js";import{g as o,m as s,s as i}from"./sourcemap-DGfgaUBb.mjs";export{o as getMap,s as mm,i as stripMap};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var f=Object.defineProperty;var c=(r,n)=>f(r,"name",{value:n,configurable:!0});import l from"./arrayFmt-Dek5cB7m.mjs";import d from"./loadModule-CovDETwT.mjs";var y=Object.defineProperty,o=c((r,n)=>y(r,"name",{value:n,configurable:!0}),"r");const p=["inject","extract","emit"],S=l(p),P=o(r=>{const n=Array.isArray(r)?r:[r];if(n[0]&&!p.includes(n[0]))throw new Error(`Incorrect mode provided, allowed modes are ${S}`);return{emit:n[0]==="emit",extract:n[0]==="extract"&&(n[1]??!0),inject:(!n[0]||n[0]==="inject")&&(n[1]??!0)}},"inferModeOption"),O=o((r,n)=>typeof r=="boolean"?r&&{}:typeof r=="object"?r:n,"inferOption"),b=o(r=>{const n=Array.isArray(r)?r:[r];return n[0]?{content:!0,...n[1],inline:n[0]==="inline"}:!1},"inferSourceMapOption"),h=o((r,n)=>{const t=O(r,{});return n&&typeof t=="object"&&!t.alias&&(t.alias=n),t},"inferHandlerOption"),a=o(async(r,n,t,e)=>{if(typeof r!="string")return r;const i=await d(r,t,e);if(!i)throw new Error(`Unable to load PostCSS ${n} \`${r}\``);return i},"ensurePCSSOption"),j=o(async(r,n,t)=>{if(r===void 0)return[];if(r.length===0)return[];const e=[];for await(const i of r.filter(Boolean)){if(!Array.isArray(i)){e.push(await a(i,"plugin",n,t));continue}const[s,u]=i;u?e.push((await a(s,"plugin",n,t))(u)):e.push(await a(s,"plugin",n,t))}return e},"ensurePCSSPlugins");export{a as ensurePCSSOption,j as ensurePCSSPlugins,h as inferHandlerOption,P as inferModeOption,O as inferOption,b as inferSourceMapOption};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var d=Object.defineProperty;var n=(e,t)=>d(e,"name",{value:t,configurable:!0});import{createRequire as c}from"node:module";import{interopDefault as m,loadModule as f}from"mlly";import{resolve as p}from"./resolve-nqhcPNJ9.mjs";var g=Object.defineProperty,u=n((e,t)=>g(e,"name",{value:t,configurable:!0}),"a");const o={},R=[".js",".mjs",".cjs",".json"],y=u(async(e,t)=>{try{return t(e)}catch(r){const s=r;if(s.code==="ERR_REQUIRE_ESM")return m(await f(e));throw s}},"loadModuleFromPath"),E=u(async(e,t,r)=>{if(o[e])return o[e];if(o[e]===null)return;const s={baseDirs:[t],caller:"Module loader",extensions:R,symlinks:!1},i=c(import.meta.url);try{const a=p([e,`./${e}`],s);if(a.startsWith("data:")){r.warn({message:`Skipping data URL module: ${e}`,module:e,plugin:"css"}),o[e]=null;return}o[e]=await y(a,i)}catch(a){r.warn({message:`Failed to resolve or load module: ${a instanceof Error?a.message:String(a)}`,module:e,plugin:"css"}),o[e]=null;return}const l=o[e];return l?.default??l},"loadModule");export{E as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var a=Object.defineProperty;var i=(o,e)=>a(o,"name",{value:e,configurable:!0});import{fileURLToPath as m}from"node:url";import{dirname as f}from"@visulima/path";import{ResolverFactory as x}from"oxc-resolver";import d from"./arrayFmt-Dek5cB7m.mjs";var u=Object.defineProperty,v=i((o,e)=>u(o,"name",{value:e,configurable:!0}),"l");const b=f(m(import.meta.url)),k=v((o,e)=>{const s={baseDirs:[b],caller:"Resolver",extensions:[".mjs",".js",".cjs",".json"],symlinks:!0,...e},c=new x({extensions:s.extensions,symlinks:s.symlinks});for(const n of s.baseDirs)for(const t of o)try{const{error:r,path:l}=c.sync(n,t);if(l)return l;r&&console.debug(r,{context:[{basedir:n,caller:e.caller,extensions:e.extensions,id:t}]})}catch(r){console.debug(r.message,{context:[{basedir:n,caller:e.caller,error:r,extensions:e.extensions,id:t}]})}throw new Error(`${s.caller} could not resolve ${d(o)}`)},"resolve");export{k as resolve};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
var Y=Object.defineProperty;var N=(e,t)=>Y(e,"name",{value:t,configurable:!0});import{createFilter as ee}from"@rollup/pluginutils";import{createRollupLogger as se}from"@visulima/packem-share/utils";import{dirname as L,normalize as M,isAbsolute as te,relative as U,resolve as oe,parse as T,join as _,basename as V}from"@visulima/path";import{isRelative as ie}from"@visulima/path/utils";import re from"p-queue";import ne from"./concat-BbvpVPBg.mjs";import{inferSourceMapOption as ae,inferModeOption as ce,inferHandlerOption as W,inferOption as G,ensurePCSSOption as R,ensurePCSSPlugins as le}from"./inferModeOption-DYyLMRb2.mjs";import{m as q}from"./sourcemap-DGfgaUBb.mjs";var ue=Object.defineProperty,de=N((e,t)=>ue(e,"name",{value:t,configurable:!0}),"r");const J=de((e,t)=>{if(!t)return!1;if(typeof t=="function")return t(e);if(typeof t.test=="function")return t.test(e);throw new Error("Invalid condition type")},"matchFile");var pe=Object.defineProperty,fe=N((e,t)=>pe(e,"name",{value:t,configurable:!0}),"a");const me=4,ge=process.env.UV_THREADPOOL_SIZE?Number.parseInt(process.env.UV_THREADPOOL_SIZE,10):me;class he{static{N(this,"c")}static{fe(this,"LoaderManager")}test;loaders=new Map;options;workQueue;logger;constructor({extensions:t,loaders:c,logger:y,options:O}){this.test=S=>t.some(g=>S.toLowerCase().endsWith(g)),c.length>0&&this.add(...c),this.options=O,this.logger=y}add(...t){for(const c of t)this.loaders.has(c.name)||this.loaders.set(c.name,c)}isSupported(t){if(this.test(t))return!0;for(const[,c]of this.loaders)if(J(t,c.test))return!0;return!1}async process(t,c){this.workQueue||(this.workQueue=new re({concurrency:ge-1}));for await(const[y,O]of this.loaders){const S={...c,options:this.options[y]??{}};if(O.alwaysProcess||J(S.id,O.test)){this.logger.debug({message:`Processing ${y} loader for ${S.id}`,plugin:"css"});try{const g=await this.workQueue.add(O.process.bind(S,t));g&&(t=g,this.logger.debug({message:`Completed ${y} loader for ${S.id}`,outputSize:g.code?.length||0,plugin:"css"}))}catch(g){throw this.logger.error({file:S.id,loader:y,message:`Error in ${y} loader for ${S.id}: ${g instanceof Error?g.message:String(g)}`,plugin:"css"}),g}}}return t}}var xe=Object.defineProperty,z=N((e,t)=>xe(e,"name",{value:t,configurable:!0}),"b");const ye=z(async(e,t)=>e.sort((c,y)=>t.indexOf(c.name)-t.indexOf(y.name)),"sortByNameOrder"),Fe=z(async(e,t,c,y,O,S,g,Z,K)=>{const C={...K,...e.alias},B=ee(e.include,e.exclude),b=ae(e.sourceMap),i={...ce(e.mode),autoModules:e.autoModules??!1,dts:e.dts,extensions:e.extensions,namedExports:e.namedExports};let a,I,H=!1;if(e.loaders)for(const r of e.loaders)r.name==="postcss"&&(H=!0);else e.loaders=[];H&&(i.postcss={...e.postcss,config:G(e.postcss?.config,{}),import:W(e.postcss?.import,C),modules:G(e.postcss?.modules,void 0),to:e.postcss?.to,url:W(e.postcss?.url,C)});let E=[];const F=z((r,u)=>{const m=[];for(const o of Object.keys(r)){const d=new Set;let h=[o];do{const $=[];for(const f of h){if(d.has(f))continue;if(I.isSupported(f)){B(f)&&$.push(f);continue}d.add(f);const P=u(f);P&&$.push(...P.importedIds)}h=$}while(h.some($=>!I.isSupported($)));m.push(...h)}return m},"traverseImportedModules");return{augmentChunkHash(r){if(E.length===0)return;const u=F(r.modules,this.getModuleInfo),m=E.filter(o=>u.includes(o.id)).sort((o,d)=>u.lastIndexOf(o.id)-u.lastIndexOf(d.id)).map(o=>`${V(o.id)}:${o.css}`);if(m.length!==0)return m.join(":")},async buildStart(){a=se(this,"css"),H&&i.postcss&&(e.postcss?.parser&&(i.postcss.parser=await R(e.postcss.parser,"parser",c,a)),e.postcss?.syntax&&(i.postcss.syntax=await R(e.postcss.syntax,"syntax",c,a)),e.postcss?.stringifier&&(i.postcss.stringifier=await R(e.postcss.stringifier,"stringifier",c,a)),e.postcss?.plugins&&(i.postcss.plugins=await le(e.postcss.plugins,c,a))),I=new he({extensions:i.extensions,loaders:await ye(e.loaders||[],["sourcemap","stylus","less","sass","postcss"]),logger:a,options:{...e,...i,alias:C}}),a.info({extract:typeof i.extract=="string"?i.extract:"individual",loaders:e.loaders?.map(r=>r.name)||[],message:"CSS plugin initialized",minify:!!(Z&&e.minifier),namedExports:!!i.namedExports,plugin:"css",sourceMap:!!S}),typeof i.inject=="object"&&i.inject.treeshakeable&&(i.namedExports=!1,a.info({message:"Disabling named exports due to `inject.treeshakeable` option",plugin:"css"}))},async generateBundle(r,u){if(E.length===0||!(r.dir||r.file))return;const m=Object.values(u),o=r.dir??L(r.file),d=m.filter(n=>n.type==="chunk"),h=d.filter(n=>!n.facadeModuleId),$=r.preserveModules?d:d.filter(n=>n.isEntry||n.isDynamicEntry),f=[],P=z(async(n,l)=>{const s=typeof i.extract=="string"?M(i.extract).replace(/^\.[/\\]/,""):M(`${n}.css`);te(s)&&this.error(["Extraction path must be relative to the output directory,",`which is ${U(c,o)}`].join(`
|
|
2
|
-
`)),ie(s)&&this.error(["Extraction path must be nested inside output directory,",`which is ${U(c,o)}`].join(`
|
|
3
|
-
`));const w=E.filter(x=>l.includes(x.id)).sort((x,v)=>l.lastIndexOf(x.id)-l.lastIndexOf(v.id)),D=await ne(w);return{css:D.css,map:q(D.map.toString()).relative(L(oe(o,s))).toString(),name:s}},"getExtractedData"),A=z(n=>{if(r.file)return T(r.file).name;if(r.preserveModules){const{dir:l,name:s}=T(n.fileName);return l?_(l,s):s}return n.name},"getName"),k=[];if(typeof i.extract=="string"){a.debug({message:`Extracting to ${i.extract}`,prefix:"css"});const n=[];for(const s of h){const w=F(s.modules,this.getModuleInfo);k.push(...w),n.push(...w)}for(const s of $)n.push(...F(s.modules,this.getModuleInfo).filter(w=>!k.includes(w)));const l=A(d[0]);f.push([l,n])}else{a.debug({message:"Extracting to individual files",prefix:"css"});for(const n of h){const l=F(n.modules,this.getModuleInfo);if(l.length===0)continue;k.push(...l);const s=A(n);f.push([s,l])}for(const n of $){const l=F(n.modules,this.getModuleInfo).filter(w=>!k.includes(w));if(l.length===0)continue;const s=A(n);f.push([s,l])}}for await(const[n,l]of f){const s=await P(n,l);if(typeof e.onExtract=="function"&&!e.onExtract(s))continue;if(Z&&e.minifier){a.info({message:`Minifying ${s.name} with ${e.minifier.name}`,prefix:"css"});const{css:x,map:v}=await e.minifier.handler.bind({browserTargets:t,logger:a})(s,b,e[e.minifier.name]??{});s.css=x,s.map=v}const w={fileName:s.name,name:s.name,names:[s.name],originalFileName:s.name,originalFileNames:[s.name],source:s.css,type:"asset"},D=this.emitFile(w);if(a.info({chunkIds:l.length,hasSourceMap:!!(s.map&&b),message:`Emitted CSS file: ${s.name}`,plugin:"css",size:s.css.length}),s.map&&b){const x=this.getFileName(D);let v="assert";typeof r.assetFileNames=="string"?v=M(L(r.assetFileNames)):typeof r.assetFileNames=="function"&&(v=M(L(r.assetFileNames(w))));const j=q(s.map).modify(p=>(p.file=V(x),p)).modifySources(p=>{if(p==="<no source>"||v.length<=1)return p;p=`../${p}`;for(const Q of v)Q==="/"&&(p=`../${p}`);return p});if(b.inline)j.modify(p=>b.transform?.(p,M(_(o,x)))),u[x].source+=j.toCommentData(),a.debug({message:`Generated inline source map for ${x}`,plugin:"css"});else{const p=`${x}.map`;j.modify(X=>b.transform?.(X,M(_(o,p)))),this.emitFile({fileName:p,source:j.toString(),type:"asset"});const{base:Q}=T(p);u[x].source+=j.toCommentFile(Q),a.debug({message:`Generated external source map: ${p}`,plugin:"css"})}}}f.length>0&&a.info({filesEmitted:f.length,message:"CSS processing complete",plugin:"css",totalExtracted:E.length,totalSize:f.reduce((n,[,l])=>n+l.length,0)})},name:"rollup-plugin-css",async transform(r,u){if(!B(u)||!I.isSupported(u))return;if(r.replaceAll(/\s/g,"")===""){a.debug({message:`Skipping empty file: ${u}`,plugin:"css"});return}a.info({message:`Processing CSS file: ${u}`,plugin:"css",size:r.length}),typeof e.onImport=="function"&&e.onImport(r,u);const m={alias:C,assets:new Map,autoModules:i.autoModules,browserTargets:t,cwd:c,debug:g,deps:new Set,dts:i.dts,emit:i.emit,environment:O,extensions:i.extensions,extract:i.extract,id:u,inject:i.inject,logger:a,namedExports:i.namedExports,options:{},plugin:this,sourceDir:y,sourceMap:b,useSourcemap:S},o=await I.process({code:r},m);a.info({assets:m.assets.size,dependencies:m.deps.size,hasExtracted:!!o.extracted,message:`Processed ${u}`,outputSize:o.code.length,plugin:"css"});for(const d of m.deps)this.addWatchFile(d);for(const[d,h]of m.assets)this.emitFile({fileName:d,source:h,type:"asset"}),a.debug({message:`Emitted asset: ${d}`,plugin:"css",size:h.length});if(o.extracted){const{id:d}=o.extracted;E=E.filter(h=>h.id!==d),E.push(o.extracted),a.debug({cssSize:o.extracted.css.length,hasSourceMap:!!o.extracted.map,message:`Extracted CSS from ${d}`,plugin:"css"})}return{code:o.code,map:b&&o.map?o.map:{mappings:""},meta:{styles:o.meta},moduleSideEffects:o.extracted?!0:void 0}}}},"cssPlugin");export{Fe as default};
|
|
@@ -1,185 +0,0 @@
|
|
|
1
|
-
import { Options } from 'cssnano';
|
|
2
|
-
import { TransformOptions, CustomAtRules } from 'lightningcss';
|
|
3
|
-
import { Node, AcceptedPlugin, PluginCreator } from 'postcss';
|
|
4
|
-
import { Config } from 'postcss-load-config';
|
|
5
|
-
import less from 'less';
|
|
6
|
-
import { Environment } from '@visulima/packem-share/types';
|
|
7
|
-
import { StringOptions as StringOptions$1 } from 'sass';
|
|
8
|
-
import { StringOptions } from 'sass-embedded';
|
|
9
|
-
import { RenderOptions } from 'stylus';
|
|
10
|
-
import { RollupLogger } from '@visulima/packem-share/utils';
|
|
11
|
-
import { PluginContext, CustomPluginOptions } from 'rollup';
|
|
12
|
-
import { RawSourceMap } from 'source-map-js';
|
|
13
|
-
|
|
14
|
-
type LESSLoaderOptions = typeof less.options;
|
|
15
|
-
|
|
16
|
-
type ImportResolve = (url: string, basedir: string, extensions: string[], atRule: Node) => Promise<string> | string;
|
|
17
|
-
|
|
18
|
-
interface ImportOptions {
|
|
19
|
-
alias: Record<string, string>;
|
|
20
|
-
debug?: boolean;
|
|
21
|
-
extensions: string[];
|
|
22
|
-
filter?: (id: string) => boolean;
|
|
23
|
-
load: (filename: string, importOptions: ImportOptions) => Promise<string> | string;
|
|
24
|
-
plugins: AcceptedPlugin[];
|
|
25
|
-
resolve: ImportResolve;
|
|
26
|
-
skipDuplicates?: boolean | undefined;
|
|
27
|
-
warnOnEmpty?: boolean;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
interface ModulesOptions {
|
|
31
|
-
exportGlobals?: boolean;
|
|
32
|
-
failOnWrongOrder?: boolean;
|
|
33
|
-
generateScopedName?: string | ((name: string, file: string, css: string) => string);
|
|
34
|
-
include?: AutoModules;
|
|
35
|
-
mode?: "global" | "local" | "pure";
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
interface UrlFile {
|
|
39
|
-
from: string;
|
|
40
|
-
source: Uint8Array;
|
|
41
|
-
urlQuery?: string;
|
|
42
|
-
}
|
|
43
|
-
type UrlResolve = (inputUrl: string, baseDirectories: string[]) => Promise<UrlFile>;
|
|
44
|
-
|
|
45
|
-
interface UrlOptions {
|
|
46
|
-
alias?: Record<string, string>;
|
|
47
|
-
assetDir?: string | ((original: string, resolved: string, file: string) => string);
|
|
48
|
-
hash?: boolean | string;
|
|
49
|
-
inline?: boolean;
|
|
50
|
-
publicPath?: string | ((original: string, resolved: string, file: string) => string);
|
|
51
|
-
resolve?: UrlResolve;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
type SassLoaderContext = {
|
|
55
|
-
environment: Environment;
|
|
56
|
-
resourcePath: string;
|
|
57
|
-
rootContext: string;
|
|
58
|
-
};
|
|
59
|
-
type SassLoaderOptions = (Omit<StringOptions<"sync">, "charset" | "indentedSyntax"> | Omit<StringOptions$1<"sync">, "charset" | "indentedSyntax">) & {
|
|
60
|
-
additionalData: string | ((content: string | Buffer, loaderContext: SassLoaderContext) => Promise<string>) | ((content: string | Buffer, loaderContext: SassLoaderContext) => string);
|
|
61
|
-
implementation?: "sass-embedded" | "sass";
|
|
62
|
-
warnRuleAsWarning?: boolean;
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
type StylusLoaderOptions = RenderOptions;
|
|
66
|
-
|
|
67
|
-
interface Extracted {
|
|
68
|
-
css: string;
|
|
69
|
-
id: string;
|
|
70
|
-
map?: string;
|
|
71
|
-
}
|
|
72
|
-
interface Loader<T = Record<string, unknown>> {
|
|
73
|
-
alwaysProcess?: boolean;
|
|
74
|
-
name: string;
|
|
75
|
-
process: (this: LoaderContext<T>, payload: Payload) => Payload | Promise<Payload>;
|
|
76
|
-
test?: RegExp | ((file: string) => boolean);
|
|
77
|
-
}
|
|
78
|
-
interface LoaderContext<T = Record<string, unknown>> {
|
|
79
|
-
readonly alias?: Record<string, string>;
|
|
80
|
-
readonly assets: Map<string, Uint8Array>;
|
|
81
|
-
readonly autoModules: InternalStyleOptions["autoModules"];
|
|
82
|
-
readonly browserTargets: string[];
|
|
83
|
-
readonly cwd?: string;
|
|
84
|
-
readonly debug?: boolean;
|
|
85
|
-
readonly deps: Set<string>;
|
|
86
|
-
readonly dts: InternalStyleOptions["dts"];
|
|
87
|
-
readonly emit: InternalStyleOptions["emit"];
|
|
88
|
-
readonly environment: Environment;
|
|
89
|
-
readonly extensions: InternalStyleOptions["extensions"];
|
|
90
|
-
readonly extract: InternalStyleOptions["extract"];
|
|
91
|
-
readonly id: string;
|
|
92
|
-
readonly inject: InternalStyleOptions["inject"];
|
|
93
|
-
readonly logger: RollupLogger;
|
|
94
|
-
readonly namedExports: InternalStyleOptions["namedExports"];
|
|
95
|
-
readonly options: T;
|
|
96
|
-
readonly plugin: PluginContext;
|
|
97
|
-
readonly sourceDir?: string;
|
|
98
|
-
readonly sourceMap: false | (SourceMapOptions & {
|
|
99
|
-
inline: boolean;
|
|
100
|
-
});
|
|
101
|
-
readonly useSourcemap: boolean;
|
|
102
|
-
}
|
|
103
|
-
interface Payload {
|
|
104
|
-
code: string;
|
|
105
|
-
dts?: string;
|
|
106
|
-
extracted?: Extracted;
|
|
107
|
-
map?: string;
|
|
108
|
-
meta?: CustomPluginOptions;
|
|
109
|
-
}
|
|
110
|
-
interface SourceMapOptions {
|
|
111
|
-
content?: boolean;
|
|
112
|
-
transform?: (map: RawSourceMap, name?: string) => void;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
type MinifierContext = {
|
|
116
|
-
readonly browserTargets: string[];
|
|
117
|
-
readonly logger: RollupLogger;
|
|
118
|
-
};
|
|
119
|
-
interface Minifier<Options = Record<string, any>> {
|
|
120
|
-
handler: (this: MinifierContext, data: ExtractedData, sourceMap: LoaderContext["sourceMap"], options: Options) => Promise<ExtractedData>;
|
|
121
|
-
name: string;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
type AutoModules = RegExp | boolean | ((id: string) => boolean);
|
|
125
|
-
interface ExtractedData {
|
|
126
|
-
css: string;
|
|
127
|
-
map?: string;
|
|
128
|
-
name: string;
|
|
129
|
-
}
|
|
130
|
-
interface InjectOptions {
|
|
131
|
-
attributes?: Record<string, string>;
|
|
132
|
-
container?: string;
|
|
133
|
-
prepend?: boolean;
|
|
134
|
-
singleTag?: boolean;
|
|
135
|
-
treeshakeable?: boolean;
|
|
136
|
-
}
|
|
137
|
-
interface InternalStyleOptions extends StyleOptions {
|
|
138
|
-
emit: boolean;
|
|
139
|
-
extensions: NonNullable<StyleOptions["extensions"]>;
|
|
140
|
-
extract: boolean | string;
|
|
141
|
-
inject: InjectOptions | boolean | ((varname: string, id: string, output: string[]) => string);
|
|
142
|
-
}
|
|
143
|
-
type LightningCSSOptions = Omit<TransformOptions<CustomAtRules>, "code" | "cssModules" | "filename" | "minify" | "targets"> & {
|
|
144
|
-
modules?: TransformOptions<CustomAtRules>["cssModules"] & {
|
|
145
|
-
include?: AutoModules;
|
|
146
|
-
};
|
|
147
|
-
};
|
|
148
|
-
interface PostCSSConfigLoaderOptions {
|
|
149
|
-
ctx?: Record<string, unknown>;
|
|
150
|
-
path?: string;
|
|
151
|
-
}
|
|
152
|
-
interface PostCSSOptions {
|
|
153
|
-
config?: PostCSSConfigLoaderOptions | false;
|
|
154
|
-
import?: Partial<ImportOptions> | false;
|
|
155
|
-
modules?: ModulesOptions | boolean;
|
|
156
|
-
parser?: Config["parser"] | string;
|
|
157
|
-
plugins?: (AcceptedPlugin | string | [PluginCreator<unknown> | string, Record<string, unknown>] | [PluginCreator<unknown> | string] | null | undefined)[] | Record<string, unknown>;
|
|
158
|
-
stringifier?: Config["stringifier"] | string;
|
|
159
|
-
syntax?: Config["syntax"] | string;
|
|
160
|
-
to?: Config["to"];
|
|
161
|
-
url?: Partial<UrlOptions> | false;
|
|
162
|
-
}
|
|
163
|
-
interface StyleOptions {
|
|
164
|
-
alias?: Record<string, string>;
|
|
165
|
-
autoModules?: AutoModules;
|
|
166
|
-
cssnano?: Options;
|
|
167
|
-
dts?: boolean;
|
|
168
|
-
exclude?: ReadonlyArray<RegExp | string> | RegExp | string | undefined;
|
|
169
|
-
extensions?: string[];
|
|
170
|
-
include?: ReadonlyArray<RegExp | string> | RegExp | string | undefined;
|
|
171
|
-
less?: LESSLoaderOptions;
|
|
172
|
-
lightningcss?: LightningCSSOptions;
|
|
173
|
-
loaders?: Loader[];
|
|
174
|
-
minifier?: Minifier;
|
|
175
|
-
mode?: "emit" | "extract" | "inject" | ["extract", string] | ["inject", InjectOptions | ((varname: string, id: string) => string)];
|
|
176
|
-
namedExports?: boolean | ((name: string) => string);
|
|
177
|
-
onExtract?: (data: ExtractedData) => boolean;
|
|
178
|
-
onImport?: (code: string, id: string) => void;
|
|
179
|
-
postcss?: PostCSSOptions;
|
|
180
|
-
sass?: SassLoaderOptions;
|
|
181
|
-
sourceMap?: boolean | "inline" | [boolean | "inline", SourceMapOptions] | [boolean | "inline"];
|
|
182
|
-
stylus?: StylusLoaderOptions;
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
export type { AutoModules as A, ExtractedData as E, InjectOptions as I, LightningCSSOptions as L, Minifier as M, PostCSSConfigLoaderOptions as P, StyleOptions as S, InternalStyleOptions as a, PostCSSOptions as b, Loader as c, LESSLoaderOptions as d, SassLoaderOptions as e, SassLoaderContext as f, StylusLoaderOptions as g, Extracted as h, LoaderContext as i };
|
package/dist/utils/index.d.mts
DELETED
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import { SourceMapGenerator, RawSourceMap, SourceMapConsumer } from 'source-map-js';
|
|
2
|
-
import { h as Extracted, b as PostCSSOptions, S as StyleOptions, a as InternalStyleOptions, i as LoaderContext } from '../packem_shared/types-BS4hXME3.mjs';
|
|
3
|
-
import { RollupLogger } from '@visulima/packem-share/utils';
|
|
4
|
-
import { Result } from 'postcss-load-config';
|
|
5
|
-
import { NapiResolveOptions } from 'oxc-resolver';
|
|
6
|
-
import 'cssnano';
|
|
7
|
-
import 'lightningcss';
|
|
8
|
-
import 'postcss';
|
|
9
|
-
import 'less';
|
|
10
|
-
import '@visulima/packem-share/types';
|
|
11
|
-
import 'sass';
|
|
12
|
-
import 'sass-embedded';
|
|
13
|
-
import 'stylus';
|
|
14
|
-
import 'rollup';
|
|
15
|
-
|
|
16
|
-
declare const arrayFmt: (array: string[]) => string;
|
|
17
|
-
|
|
18
|
-
interface Concatenated {
|
|
19
|
-
css: string;
|
|
20
|
-
map: SourceMapGenerator;
|
|
21
|
-
}
|
|
22
|
-
declare const concat: (extracted: Extracted[]) => Promise<Concatenated>;
|
|
23
|
-
|
|
24
|
-
declare const loadModule: (moduleId: string, cwd: string, logger: RollupLogger) => Promise<any>;
|
|
25
|
-
|
|
26
|
-
interface Mode {
|
|
27
|
-
emit: InternalStyleOptions["emit"];
|
|
28
|
-
extract: InternalStyleOptions["extract"];
|
|
29
|
-
inject: InternalStyleOptions["inject"];
|
|
30
|
-
}
|
|
31
|
-
type PCSSOption = "parser" | "plugin" | "stringifier" | "syntax";
|
|
32
|
-
declare const inferModeOption: (mode: StyleOptions["mode"]) => Mode;
|
|
33
|
-
declare const inferOption: <T, TDefine extends T | boolean | undefined>(option: T | boolean | undefined, defaultValue: TDefine) => T | TDefine | false;
|
|
34
|
-
declare const inferSourceMapOption: (sourceMap: StyleOptions["sourceMap"]) => LoaderContext["sourceMap"];
|
|
35
|
-
declare const inferHandlerOption: <T extends {
|
|
36
|
-
alias?: Record<string, string>;
|
|
37
|
-
}>(option: T | boolean | undefined, alias: T["alias"]) => T | false;
|
|
38
|
-
declare const ensurePCSSOption: <T>(option: T | string, type: PCSSOption, cwd: string, logger: RollupLogger) => Promise<T>;
|
|
39
|
-
declare const ensurePCSSPlugins: (plugins: PostCSSOptions["plugins"], cwd: string, logger: RollupLogger) => Promise<Result["plugins"]>;
|
|
40
|
-
|
|
41
|
-
declare const resolve: (ids: string[], userOptions: ResolveOptions) => string;
|
|
42
|
-
interface ResolveOptions extends NapiResolveOptions {
|
|
43
|
-
baseDirs?: string[];
|
|
44
|
-
caller?: string;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
declare const safeId: (id: string, ...salt: string[]) => string;
|
|
48
|
-
|
|
49
|
-
declare class MapModifier {
|
|
50
|
-
private readonly map?;
|
|
51
|
-
constructor(map?: RawSourceMap | string);
|
|
52
|
-
modify(f: (m: RawSourceMap) => void): this;
|
|
53
|
-
modifySources(op: (source: string) => string): this;
|
|
54
|
-
resolve(directory?: string): this;
|
|
55
|
-
relative(directory?: string): this;
|
|
56
|
-
toObject(): RawSourceMap | undefined;
|
|
57
|
-
toString(): string | undefined;
|
|
58
|
-
toConsumer(): SourceMapConsumer | undefined;
|
|
59
|
-
toCommentData(): string;
|
|
60
|
-
toCommentFile(fileName: string): string;
|
|
61
|
-
}
|
|
62
|
-
declare const getMap: (code: string, id?: string) => Promise<string | undefined>;
|
|
63
|
-
declare const stripMap: (code: string) => string;
|
|
64
|
-
declare const mm: (map?: RawSourceMap | string) => MapModifier;
|
|
65
|
-
|
|
66
|
-
declare const hasModuleSpecifier: (url: string) => boolean;
|
|
67
|
-
declare const getUrlOfPartial: (url: string) => string;
|
|
68
|
-
declare const normalizeUrl: (url: string) => string;
|
|
69
|
-
|
|
70
|
-
export { arrayFmt, concat, ensurePCSSOption, ensurePCSSPlugins, getMap, getUrlOfPartial, hasModuleSpecifier, inferHandlerOption, inferModeOption, inferOption, inferSourceMapOption, loadModule, mm, normalizeUrl, resolve, safeId, stripMap };
|
|
71
|
-
export type { ResolveOptions };
|
package/dist/utils/index.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{default as o}from"../packem_shared/arrayFmt-Dek5cB7m.mjs";import{default as t}from"../packem_shared/concat-BbvpVPBg.mjs";import{default as p}from"../packem_shared/loadModule-CovDETwT.mjs";import{ensurePCSSOption as n,ensurePCSSPlugins as s,inferHandlerOption as l,inferModeOption as m,inferOption as d,inferSourceMapOption as u}from"../packem_shared/inferModeOption-DYyLMRb2.mjs";import{resolve as M}from"../packem_shared/resolve-nqhcPNJ9.mjs";import{default as S}from"../packem_shared/safeId-BN5akJYJ.mjs";import{g,m as P,s as C}from"../packem_shared/sourcemap-DGfgaUBb.mjs";import{getUrlOfPartial as h,hasModuleSpecifier as v,normalizeUrl as y}from"../packem_shared/hasModuleSpecifier-DIZeev_W.mjs";export{o as arrayFmt,t as concat,n as ensurePCSSOption,s as ensurePCSSPlugins,g as getMap,h as getUrlOfPartial,v as hasModuleSpecifier,l as inferHandlerOption,m as inferModeOption,d as inferOption,u as inferSourceMapOption,p as loadModule,P as mm,y as normalizeUrl,M as resolve,S as safeId,C as stripMap};
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/dist/packem_shared/{ensure-auto-modules-BU3xWEjl.mjs → ensure-auto-modules-BU3xWEjl.js}
RENAMED
|
File without changes
|
/package/dist/packem_shared/{hasModuleSpecifier-DIZeev_W.mjs → hasModuleSpecifier-DIZeev_W.js}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|