@visulima/rollup-plugin-css 1.0.0-alpha.1

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.
Files changed (52) hide show
  1. package/CHANGELOG.md +161 -0
  2. package/LICENSE.md +377 -0
  3. package/README.md +463 -0
  4. package/dist/index.d.mts +20 -0
  5. package/dist/index.d.ts +20 -0
  6. package/dist/index.mjs +1 -0
  7. package/dist/loaders/less/index.d.mts +17 -0
  8. package/dist/loaders/less/index.d.ts +9 -0
  9. package/dist/loaders/less/index.mjs +1 -0
  10. package/dist/loaders/lightningcss.d.mts +17 -0
  11. package/dist/loaders/lightningcss.d.ts +17 -0
  12. package/dist/loaders/lightningcss.mjs +3 -0
  13. package/dist/loaders/postcss/index.d.mts +17 -0
  14. package/dist/loaders/postcss/index.d.ts +17 -0
  15. package/dist/loaders/postcss/index.mjs +6 -0
  16. package/dist/loaders/sass/index.d.mts +18 -0
  17. package/dist/loaders/sass/index.d.ts +9 -0
  18. package/dist/loaders/sass/index.mjs +8 -0
  19. package/dist/loaders/sourcemap.d.mts +17 -0
  20. package/dist/loaders/sourcemap.d.ts +17 -0
  21. package/dist/loaders/sourcemap.mjs +1 -0
  22. package/dist/loaders/stylus/index.d.mts +17 -0
  23. package/dist/loaders/stylus/index.d.ts +9 -0
  24. package/dist/loaders/stylus/index.mjs +1 -0
  25. package/dist/loaders/tailwindcss-oxide.d.mts +17 -0
  26. package/dist/loaders/tailwindcss-oxide.d.ts +17 -0
  27. package/dist/loaders/tailwindcss-oxide.mjs +1 -0
  28. package/dist/minifiers/cssnano.d.mts +17 -0
  29. package/dist/minifiers/cssnano.d.ts +17 -0
  30. package/dist/minifiers/cssnano.mjs +1 -0
  31. package/dist/minifiers/lightningcss.d.mts +17 -0
  32. package/dist/minifiers/lightningcss.d.ts +17 -0
  33. package/dist/minifiers/lightningcss.mjs +3 -0
  34. package/dist/packem_shared/arrayFmt-Dek5cB7m.mjs +1 -0
  35. package/dist/packem_shared/concat-BbvpVPBg.mjs +3 -0
  36. package/dist/packem_shared/cssModulesTypesPlugin-B9_bJo_B.mjs +10 -0
  37. package/dist/packem_shared/ensure-auto-modules-BU3xWEjl.mjs +1 -0
  38. package/dist/packem_shared/generate-js-exports-Cg7EXFF1.mjs +14 -0
  39. package/dist/packem_shared/getMap-BL5hKEnR.mjs +1 -0
  40. package/dist/packem_shared/hasModuleSpecifier-DIZeev_W.mjs +1 -0
  41. package/dist/packem_shared/inferModeOption-DYyLMRb2.mjs +1 -0
  42. package/dist/packem_shared/loadModule-CovDETwT.mjs +1 -0
  43. package/dist/packem_shared/resolve-nqhcPNJ9.mjs +1 -0
  44. package/dist/packem_shared/rollupCssPlugin-D-7azn92.mjs +3 -0
  45. package/dist/packem_shared/safeId-BN5akJYJ.mjs +1 -0
  46. package/dist/packem_shared/sourcemap-DGfgaUBb.mjs +3 -0
  47. package/dist/packem_shared/types-BS4hXME3.d.mts +185 -0
  48. package/dist/packem_shared/types-BS4hXME3.d.ts +185 -0
  49. package/dist/utils/index.d.mts +71 -0
  50. package/dist/utils/index.d.ts +71 -0
  51. package/dist/utils/index.mjs +1 -0
  52. package/package.json +201 -0
package/README.md ADDED
@@ -0,0 +1,463 @@
1
+ # @visulima/rollup-plugin-css
2
+
3
+ A comprehensive CSS processing plugin for [Packem](https://github.com/visulima/packem) that provides support for multiple CSS preprocessors, CSS modules, and advanced optimization features.
4
+
5
+ ## Features
6
+
7
+ ### 🎨 CSS Preprocessors
8
+
9
+ - **PostCSS** - Modern CSS transformations with plugin ecosystem
10
+ - **Sass/SCSS** - Popular CSS extension language
11
+ - **Less** - Dynamic stylesheet language
12
+ - **Stylus** - Expressive, dynamic, robust CSS
13
+ - **Tailwind CSS v4** - Latest Tailwind CSS with PostCSS integration
14
+ - **Tailwind Oxide** - Next-generation Tailwind CSS with Rust-based engine
15
+
16
+ ### 🔧 CSS Processing
17
+
18
+ - **CSS Modules** - Localized CSS with automatic class name generation
19
+ - **CSS Minification** - Using cssnano or LightningCSS
20
+ - **Source Maps** - Full source map support for debugging
21
+ - **Auto-prefixing** - Automatic vendor prefix handling
22
+
23
+ ### 📦 Integration Modes
24
+
25
+ - **Inject** - Embed CSS in JavaScript and inject at runtime
26
+ - **Extract** - Extract CSS to separate `.css` files
27
+ - **Emit** - Pass processed CSS through the build pipeline
28
+
29
+ ### 🔤 TypeScript Support
30
+
31
+ - **CSS Modules Types** - Automatic TypeScript declaration generation for CSS modules
32
+ - **Type Safety** - Full IntelliSense support for CSS class names
33
+ - **Auto-Generated .d.ts** - Companion declaration files for CSS modules
34
+
35
+ ## Installation
36
+
37
+ ```bash
38
+ npm install --save-dev @visulima/rollup-plugin-css
39
+ ```
40
+
41
+ Or with other package managers:
42
+
43
+ ```bash
44
+ yarn add -D @visulima/rollup-plugin-css
45
+ ```
46
+
47
+ ```bash
48
+ pnpm add -D @visulima/rollup-plugin-css
49
+ ```
50
+
51
+ ### Peer Dependencies
52
+
53
+ Install the CSS processors you need:
54
+
55
+ ```bash
56
+ # PostCSS (recommended)
57
+ npm install postcss
58
+
59
+ # Sass/SCSS
60
+ npm install sass-embedded
61
+
62
+ # Less
63
+ npm install less
64
+
65
+ # Stylus
66
+ npm install stylus
67
+
68
+ # LightningCSS (for fast processing and minification)
69
+ npm install lightningcss
70
+
71
+ # cssnano (for CSS minification)
72
+ npm install cssnano
73
+
74
+ # Tailwind CSS v4 (PostCSS-based)
75
+ npm install tailwindcss @tailwindcss/postcss
76
+
77
+ # Tailwind Oxide (Rust-based engine)
78
+ npm install @tailwindcss/node @tailwindcss/oxide
79
+
80
+ # CSS Style Injection (required for inject mode)
81
+ npm install @visulima/css-style-inject
82
+ ```
83
+
84
+ ## Usage
85
+
86
+ The `@visulima/rollup-plugin-css` provides comprehensive CSS processing capabilities for Rollup and Packem builds.
87
+
88
+ ### Basic CSS Processing
89
+
90
+ ```typescript
91
+ import { rollupCssPlugin } from "@visulima/rollup-plugin-css";
92
+
93
+ export default {
94
+ plugins: [
95
+ rollupCssPlugin({
96
+ // Extract CSS to separate files
97
+ mode: "extract",
98
+
99
+ // Enable CSS modules for .module.css files
100
+ autoModules: /\.module\./,
101
+
102
+ // Enable source maps
103
+ sourceMap: true,
104
+
105
+ // CSS minification
106
+ minifier: "cssnano",
107
+ })
108
+ ]
109
+ };
110
+ ```
111
+
112
+ ### Multiple Preprocessors
113
+
114
+ ```typescript
115
+ import { rollupCssPlugin } from "@visulima/rollup-plugin-css";
116
+
117
+ export default {
118
+ plugins: [
119
+ rollupCssPlugin({
120
+ // File extensions to process
121
+ extensions: [".css", ".scss", ".sass", ".less", ".styl"],
122
+
123
+ // CSS Modules configuration
124
+ autoModules: true,
125
+ namedExports: true,
126
+
127
+ // PostCSS configuration
128
+ postcss: {
129
+ plugins: [
130
+ require("autoprefixer"),
131
+ require("tailwindcss"),
132
+ ],
133
+ modules: {
134
+ generateScopedName: "[name]__[local]___[hash:base64:5]",
135
+ },
136
+ },
137
+
138
+ // Sass configuration
139
+ sass: {
140
+ includePaths: ["node_modules"],
141
+ outputStyle: "compressed",
142
+ },
143
+
144
+ // Minification
145
+ minifier: "lightningcss",
146
+ })
147
+ ]
148
+ };
149
+ ```
150
+
151
+ ### CSS Injection Mode
152
+
153
+ **Note:** Inject mode requires `@visulima/css-style-inject` to be installed.
154
+
155
+ ```typescript
156
+ import { rollupCssPlugin } from "@visulima/rollup-plugin-css";
157
+
158
+ export default {
159
+ plugins: [
160
+ rollupCssPlugin({
161
+ // Inject CSS into JavaScript
162
+ mode: "inject",
163
+
164
+ // Enable CSS modules
165
+ autoModules: true,
166
+
167
+ // PostCSS with autoprefixer
168
+ postcss: {
169
+ plugins: [require("autoprefixer")],
170
+ },
171
+
172
+ // Minification
173
+ minifier: "cssnano",
174
+ })
175
+ ]
176
+ };
177
+ ```
178
+
179
+ ### Tailwind CSS v4 with PostCSS
180
+
181
+ ```typescript
182
+ import { rollupCssPlugin } from "@visulima/rollup-plugin-css";
183
+
184
+ export default {
185
+ plugins: [
186
+ rollupCssPlugin({
187
+ mode: "extract",
188
+ autoModules: true,
189
+ postcss: {
190
+ plugins: [
191
+ require("@tailwindcss/postcss"),
192
+ require("autoprefixer"),
193
+ ],
194
+ },
195
+ minifier: "cssnano",
196
+ })
197
+ ]
198
+ };
199
+ ```
200
+
201
+ ```javascript
202
+ // postcss.config.js
203
+ export default {
204
+ plugins: {
205
+ "@tailwindcss/postcss": {},
206
+ },
207
+ }
208
+ ```
209
+
210
+ ### Tailwind Oxide (Rust-based)
211
+
212
+ ```typescript
213
+ import { rollupCssPlugin } from "@visulima/rollup-plugin-css";
214
+
215
+ export default {
216
+ plugins: [
217
+ rollupCssPlugin({
218
+ mode: "extract",
219
+ autoModules: true,
220
+ // Tailwind Oxide configuration
221
+ tailwind: {
222
+ oxide: true,
223
+ config: "./tailwind.config.js",
224
+ },
225
+ minifier: "cssnano",
226
+ })
227
+ ]
228
+ };
229
+ ```
230
+
231
+ ## Examples
232
+
233
+ ### CSS Modules with React
234
+
235
+ ```css
236
+ /* src/index.module.css */
237
+ .test {
238
+ color: red;
239
+ }
240
+
241
+ .container {
242
+ display: flex;
243
+ justify-content: center;
244
+ align-items: center;
245
+ height: 100vh;
246
+ width: 100vw;
247
+ }
248
+ ```
249
+
250
+ ```typescript
251
+ /* src/index.tsx */
252
+ import styles from "./index.module.css";
253
+
254
+ const Container = () => {
255
+ return (
256
+ <div className={styles.container}>
257
+ <div className={styles.test}>
258
+ <h1>Hello World</h1>
259
+ </div>
260
+ </div>
261
+ );
262
+ };
263
+
264
+ export default Container;
265
+ ```
266
+
267
+ The plugin automatically generates TypeScript declarations:
268
+
269
+ ```typescript
270
+ /* src/index.module.css.d.ts */
271
+ declare const css: string;
272
+ declare const test: "index_test_bcd2d774";
273
+ declare const container: "index_container_bcd2d774";
274
+
275
+ interface ModulesExports {
276
+ 'test': string;
277
+ 'container': string;
278
+ }
279
+
280
+ declare const modules_c21c94f2: ModulesExports;
281
+
282
+ export default modules_c21c94f2;
283
+
284
+ export {
285
+ css,
286
+ test,
287
+ container
288
+ };
289
+ ```
290
+
291
+ ### Multiple CSS Preprocessors
292
+
293
+ ```javascript
294
+ /* src/index.js */
295
+ import foo from "./foo.css" with { type: "css" };
296
+ import bar from "./bar.css";
297
+ import "./style.styl";
298
+ import "./style.pcss";
299
+ import "./style.sass";
300
+ import "./style.scss";
301
+ import "./style.less";
302
+
303
+ console.log(foo, bar);
304
+ ```
305
+
306
+ Supports all major CSS preprocessors:
307
+
308
+ - **Stylus** (`.styl`)
309
+ - **PostCSS** (`.pcss`)
310
+ - **Sass** (`.sass`, `.scss`)
311
+ - **Less** (`.less`)
312
+
313
+ ### Tailwind CSS v4 Integration
314
+
315
+ ```css
316
+ /* src/styles.css */
317
+ @import "tailwindcss";
318
+ ```
319
+
320
+ ```typescript
321
+ /* src/index.tsx */
322
+ import "./styles.css";
323
+
324
+ const Container = () => {
325
+ return (
326
+ <div className="bg-red-500 h-32">
327
+ <h1>Hello World</h1>
328
+ </div>
329
+ );
330
+ };
331
+
332
+ export default Container;
333
+ ```
334
+
335
+ ### Tailwind Oxide Integration
336
+
337
+ Using the Rust-based engine for ultra-fast processing:
338
+
339
+ ```css
340
+ /* src/styles.css */
341
+ @import "tailwindcss";
342
+ ```
343
+
344
+ The Oxide loader provides:
345
+
346
+ - **Ultra-fast compilation** with Rust-based engine
347
+ - **Just-in-time processing** for optimal bundle sizes
348
+ - **Smart content detection** and automatic purging
349
+
350
+ ## API Reference
351
+
352
+ ### rollupCssPlugin(options)
353
+
354
+ Main CSS processing plugin for Rollup.
355
+
356
+ #### Core Options
357
+
358
+ - `mode` - Processing mode: `"inject"` | `"extract"` | `"emit"`
359
+ - `extensions` - File extensions to process
360
+ - `include/exclude` - File inclusion/exclusion patterns
361
+ - `autoModules` - Enable CSS modules automatically
362
+ - `namedExports` - Enable named exports for CSS classes
363
+
364
+ #### Preprocessor Options
365
+
366
+ - `postcss` - PostCSS configuration and plugins
367
+ - `sass` - Sass/SCSS compiler options
368
+ - `less` - Less compiler options
369
+ - `stylus` - Stylus compiler options
370
+ - `tailwind` - Tailwind CSS configuration
371
+
372
+ #### Output Options
373
+
374
+ - `sourceMap` - Source map generation
375
+ - `minifier` - CSS minification strategy: `"cssnano"` | `"lightningcss"`
376
+ - `dts` - Generate TypeScript declaration files
377
+
378
+ ## Configuration Modes
379
+
380
+ ### Extract Mode
381
+
382
+ Extracts CSS into separate `.css` files:
383
+
384
+ ```typescript
385
+ rollupCssPlugin({
386
+ mode: "extract", // Creates separate CSS files
387
+ autoModules: true,
388
+ minifier: "cssnano",
389
+ })
390
+ ```
391
+
392
+ ### Inject Mode
393
+
394
+ Injects CSS directly into JavaScript at runtime. **Requires `@visulima/css-style-inject`:**
395
+
396
+ ```typescript
397
+ rollupCssPlugin({
398
+ mode: "inject", // CSS embedded in JS
399
+ autoModules: true,
400
+ minifier: "cssnano",
401
+ })
402
+ ```
403
+
404
+ ## CSS Modules Features
405
+
406
+ CSS Modules provide automatic class name scoping and TypeScript integration:
407
+
408
+ ### Automatic TypeScript Declarations
409
+ - **Generated .d.ts files** for full IntelliSense support
410
+ - **Named exports** for individual class names
411
+ - **Default export** with complete module interface
412
+ - **Build-time type checking** prevents runtime errors
413
+
414
+ ### Scoped Class Names
415
+ - **Automatic hashing** prevents style conflicts
416
+ - **Deterministic naming** for consistent builds
417
+ - **Development-friendly** class names for debugging
418
+
419
+ ### Integration Benefits
420
+ - **Zero configuration** - works out of the box with `.module.css` files
421
+ - **Watch mode support** - declarations update automatically
422
+ - **Build pipeline integration** - seamless Rollup integration
423
+
424
+ ## Key Features
425
+
426
+ ### Tailwind Integration
427
+ - **Tailwind CSS v4** - Latest version with PostCSS integration
428
+ - **Tailwind Oxide** - Rust-based engine for ultra-fast processing
429
+ - **JIT compilation** - Generate only the CSS you use
430
+ - **Smart purging** - Automatic unused style removal
431
+
432
+ ### Preprocessor Support
433
+ - **PostCSS** - Modern CSS transformations with extensive plugin ecosystem
434
+ - **Sass/SCSS** - Popular CSS extension language with variables and mixins
435
+ - **Less** - Dynamic stylesheet language with variables and functions
436
+ - **Stylus** - Expressive, dynamic CSS preprocessor
437
+
438
+ ### Performance Optimization
439
+ - **Multiple minifiers** - Choose between cssnano and LightningCSS
440
+ - **Source maps** - Full debugging support in development
441
+ - **Code splitting** - Efficient CSS bundling strategies
442
+ - **Asset optimization** - Automatic CSS optimization and compression
443
+
444
+ ## PostCSS Integration
445
+
446
+ Leverage the extensive PostCSS ecosystem through configuration files:
447
+
448
+ ```javascript
449
+ // postcss.config.js
450
+ export default {
451
+ plugins: {
452
+ "@tailwindcss/postcss": {},
453
+ "autoprefixer": {},
454
+ "postcss-nested": {},
455
+ },
456
+ }
457
+ ```
458
+
459
+ The PostCSS loader automatically detects and uses your PostCSS configuration.
460
+
461
+ ## License
462
+
463
+ MIT © [Daniel Bannert](https://github.com/prisis)
@@ -0,0 +1,20 @@
1
+ import { Plugin } from 'rollup';
2
+ import { S as StyleOptions } from './packem_shared/types-BS4hXME3.mjs';
3
+ export { A as AutoModules, E as ExtractedData, I as InjectOptions, a as InternalStyleOptions, L as LightningCSSOptions, P as PostCSSConfigLoaderOptions, b as PostCSSOptions } from './packem_shared/types-BS4hXME3.mjs';
4
+ import { Environment } from '@visulima/packem-share/types';
5
+ import 'cssnano';
6
+ import 'lightningcss';
7
+ import 'postcss';
8
+ import 'postcss-load-config';
9
+ import 'less';
10
+ import 'sass';
11
+ import 'sass-embedded';
12
+ import 'stylus';
13
+ import '@visulima/packem-share/utils';
14
+ import 'source-map-js';
15
+
16
+ declare const cssModulesTypesPlugin: (options: StyleOptions, rootDirectory: string) => Plugin;
17
+
18
+ declare const cssPlugin: (options: StyleOptions, browserTargets: string[], cwd: string, sourceDirectory: string, environment: Environment, useSourcemap: boolean, debug: boolean, minify: boolean, alias: Record<string, string>) => Promise<Plugin>;
19
+
20
+ export { StyleOptions, cssModulesTypesPlugin, cssPlugin as rollupCssPlugin };
@@ -0,0 +1,20 @@
1
+ import { Plugin } from 'rollup';
2
+ import { S as StyleOptions } from './packem_shared/types-BS4hXME3.js';
3
+ export { A as AutoModules, E as ExtractedData, I as InjectOptions, a as InternalStyleOptions, L as LightningCSSOptions, P as PostCSSConfigLoaderOptions, b as PostCSSOptions } from './packem_shared/types-BS4hXME3.js';
4
+ import { Environment } from '@visulima/packem-share/types';
5
+ import 'cssnano';
6
+ import 'lightningcss';
7
+ import 'postcss';
8
+ import 'postcss-load-config';
9
+ import 'less';
10
+ import 'sass';
11
+ import 'sass-embedded';
12
+ import 'stylus';
13
+ import '@visulima/packem-share/utils';
14
+ import 'source-map-js';
15
+
16
+ declare const cssModulesTypesPlugin: (options: StyleOptions, rootDirectory: string) => Plugin;
17
+
18
+ declare const cssPlugin: (options: StyleOptions, browserTargets: string[], cwd: string, sourceDirectory: string, environment: Environment, useSourcemap: boolean, debug: boolean, minify: boolean, alias: Record<string, string>) => Promise<Plugin>;
19
+
20
+ export { StyleOptions, cssModulesTypesPlugin, cssPlugin as rollupCssPlugin };
package/dist/index.mjs ADDED
@@ -0,0 +1 @@
1
+ import{default as e}from"./packem_shared/cssModulesTypesPlugin-B9_bJo_B.mjs";import{default as u}from"./packem_shared/rollupCssPlugin-D-7azn92.mjs";export{e as cssModulesTypesPlugin,u as rollupCssPlugin};
@@ -0,0 +1,17 @@
1
+ import { c as Loader, d as LESSLoaderOptions } 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<LESSLoaderOptions>;
16
+
17
+ export { LESSLoaderOptions, loader as default };
@@ -0,0 +1,9 @@
1
+ // @ts-ignore
2
+ loader;
3
+ export { LESSLoaderOptions };
4
+ declare namespace loader {
5
+ export const loader: Loader<LESSLoaderOptions>;
6
+ import _default = loader;
7
+ export { _default as default };
8
+ }
9
+ export = loader;
@@ -0,0 +1 @@
1
+ var c=Object.defineProperty;var l=(s,e)=>c(s,"name",{value:e,configurable:!0});import{dirname as u,normalize as d}from"@visulima/path";import f from"less";import{readFileSync as h}from"@visulima/fs";import{resolveAlias as g}from"@visulima/path/utils";import{resolve as y}from"../../packem_shared/resolve-nqhcPNJ9.mjs";import{normalizeUrl as F,getUrlOfPartial as v}from"../../packem_shared/hasModuleSpecifier-DIZeev_W.mjs";var b=Object.defineProperty,m=l((s,e)=>b(s,"name",{value:e,configurable:!0}),"i");const M=[".less",".css"],x=m((s,e)=>new class extends s.FileManager{supports(){return!0}async loadFile(r,a,t){const i=F(g(r,e)),o=v(i),n={baseDirs:[],caller:"Less importer",extensions:M};Array.isArray(t.paths)&&n.baseDirs.push(...t.paths),n.baseDirs.push(a);const p=y([o,i],n);return{contents:h(p),filename:p}}},"getStylesFileManager"),A=m(s=>({install(e,r){r.addFileManager(x(e,s))}}),"importer"),U={name:"less",async process({code:s,map:e}){const r=[A(this.alias)];this.options.plugins&&r.push(...this.options.plugins);const a=f.render,t=await a(s,{...this.options,filename:this.id,plugins:r,sourceMap:{outputSourceFiles:!0,sourceMapBasepath:u(this.id)}}),i=t.imports;for(const o of i)this.deps.add(d(o));return{code:t.css,map:t.map??e}},test:/\.less$/i};export{U as default};
@@ -0,0 +1,17 @@
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 };
@@ -0,0 +1,17 @@
1
+ import { c as Loader, L as LightningCSSOptions } from '../packem_shared/types-BS4hXME3.js';
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;
@@ -0,0 +1,3 @@
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};
@@ -0,0 +1,17 @@
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 };
@@ -0,0 +1,17 @@
1
+ import { c as Loader, a as InternalStyleOptions } from '../../packem_shared/types-BS4hXME3.js';
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;