@visulima/rollup-plugin-css 1.0.0-alpha.6 → 1.0.0-alpha.8
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 +36 -0
- 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-Dqps7nWG.mjs → generate-js-exports-BhS4eLrN.js} +1 -1
- 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-CA9pSumu.d.mts → types-D3VQL1eC.d.ts} +2 -2
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/index.js +1 -0
- package/package.json +52 -37
- 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/getMap-BL5hKEnR.mjs +0 -1
- package/dist/packem_shared/inferModeOption-fAc592HP.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-CJSS-7Mi.mjs +0 -3
- package/dist/packem_shared/types-CA9pSumu.d.ts +0 -189
- package/dist/utils/index.d.mts +0 -73
- 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,189 +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 inline: InternalStyleOptions["inline"];
|
|
94
|
-
readonly logger: RollupLogger;
|
|
95
|
-
readonly namedExports: InternalStyleOptions["namedExports"];
|
|
96
|
-
readonly options: T;
|
|
97
|
-
readonly plugin: PluginContext;
|
|
98
|
-
readonly sourceDir?: string;
|
|
99
|
-
readonly sourceMap: false | (SourceMapOptions & {
|
|
100
|
-
inline: boolean;
|
|
101
|
-
});
|
|
102
|
-
readonly useSourcemap: boolean;
|
|
103
|
-
}
|
|
104
|
-
interface Payload {
|
|
105
|
-
code: string;
|
|
106
|
-
dts?: string;
|
|
107
|
-
extracted?: Extracted;
|
|
108
|
-
map?: string;
|
|
109
|
-
meta?: CustomPluginOptions;
|
|
110
|
-
}
|
|
111
|
-
interface SourceMapOptions {
|
|
112
|
-
content?: boolean;
|
|
113
|
-
transform?: (map: RawSourceMap, name?: string) => void;
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
type MinifierContext = {
|
|
117
|
-
readonly browserTargets: string[];
|
|
118
|
-
readonly logger: RollupLogger;
|
|
119
|
-
};
|
|
120
|
-
interface Minifier<Options = Record<string, any>> {
|
|
121
|
-
handler: (this: MinifierContext, data: ExtractedData, sourceMap: LoaderContext["sourceMap"], options: Options) => Promise<ExtractedData>;
|
|
122
|
-
name: string;
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
type AutoModules = RegExp | boolean | ((id: string) => boolean);
|
|
126
|
-
interface ExtractedData {
|
|
127
|
-
css: string;
|
|
128
|
-
map?: string;
|
|
129
|
-
name: string;
|
|
130
|
-
}
|
|
131
|
-
interface InjectOptions {
|
|
132
|
-
attributes?: Record<string, string>;
|
|
133
|
-
container?: string;
|
|
134
|
-
method?: string;
|
|
135
|
-
package?: string;
|
|
136
|
-
prepend?: boolean;
|
|
137
|
-
singleTag?: boolean;
|
|
138
|
-
treeshakeable?: boolean;
|
|
139
|
-
}
|
|
140
|
-
interface InternalStyleOptions extends StyleOptions {
|
|
141
|
-
emit: boolean;
|
|
142
|
-
extensions: NonNullable<StyleOptions["extensions"]>;
|
|
143
|
-
extract: boolean | string;
|
|
144
|
-
inject: InjectOptions | boolean | ((varname: string, id: string, output: string[]) => string);
|
|
145
|
-
inline: boolean;
|
|
146
|
-
}
|
|
147
|
-
type LightningCSSOptions = Omit<TransformOptions<CustomAtRules>, "code" | "cssModules" | "filename" | "minify" | "targets"> & {
|
|
148
|
-
modules?: TransformOptions<CustomAtRules>["cssModules"] & {
|
|
149
|
-
include?: AutoModules;
|
|
150
|
-
};
|
|
151
|
-
};
|
|
152
|
-
interface PostCSSConfigLoaderOptions {
|
|
153
|
-
ctx?: Record<string, unknown>;
|
|
154
|
-
path?: string;
|
|
155
|
-
}
|
|
156
|
-
interface PostCSSOptions {
|
|
157
|
-
config?: PostCSSConfigLoaderOptions | false;
|
|
158
|
-
import?: Partial<ImportOptions> | false;
|
|
159
|
-
modules?: ModulesOptions | boolean;
|
|
160
|
-
parser?: Config["parser"] | string;
|
|
161
|
-
plugins?: (AcceptedPlugin | string | [PluginCreator<unknown> | string, Record<string, unknown>] | [PluginCreator<unknown> | string] | null | undefined)[] | Record<string, unknown>;
|
|
162
|
-
stringifier?: Config["stringifier"] | string;
|
|
163
|
-
syntax?: Config["syntax"] | string;
|
|
164
|
-
to?: Config["to"];
|
|
165
|
-
url?: Partial<UrlOptions> | false;
|
|
166
|
-
}
|
|
167
|
-
interface StyleOptions {
|
|
168
|
-
alias?: Record<string, string>;
|
|
169
|
-
autoModules?: AutoModules;
|
|
170
|
-
cssnano?: Options;
|
|
171
|
-
dts?: boolean;
|
|
172
|
-
exclude?: ReadonlyArray<RegExp | string> | RegExp | string | undefined;
|
|
173
|
-
extensions?: string[];
|
|
174
|
-
include?: ReadonlyArray<RegExp | string> | RegExp | string | undefined;
|
|
175
|
-
less?: LESSLoaderOptions;
|
|
176
|
-
lightningcss?: LightningCSSOptions;
|
|
177
|
-
loaders?: Loader[];
|
|
178
|
-
minifier?: Minifier;
|
|
179
|
-
mode?: "emit" | "extract" | "inject" | "inline" | ["extract", string] | ["inject", InjectOptions | ((varname: string, id: string) => string)];
|
|
180
|
-
namedExports?: boolean | ((name: string) => string);
|
|
181
|
-
onExtract?: (data: ExtractedData) => boolean;
|
|
182
|
-
onImport?: (code: string, id: string) => void;
|
|
183
|
-
postcss?: PostCSSOptions;
|
|
184
|
-
sass?: SassLoaderOptions;
|
|
185
|
-
sourceMap?: boolean | "inline" | [boolean | "inline", SourceMapOptions] | [boolean | "inline"];
|
|
186
|
-
stylus?: StylusLoaderOptions;
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
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,73 +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-CA9pSumu.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
|
-
inline: InternalStyleOptions["inline"];
|
|
31
|
-
}
|
|
32
|
-
type PCSSOption = "parser" | "plugin" | "stringifier" | "syntax";
|
|
33
|
-
declare const inferModeOption: (mode: StyleOptions["mode"]) => Mode;
|
|
34
|
-
declare const inferOption: <T, TDefine extends T | boolean | undefined>(option: T | boolean | undefined, defaultValue: TDefine) => OptionType<T, TDefine>;
|
|
35
|
-
declare const inferSourceMapOption: (sourceMap: StyleOptions["sourceMap"]) => LoaderContext["sourceMap"];
|
|
36
|
-
declare const inferHandlerOption: <T extends {
|
|
37
|
-
alias?: Record<string, string>;
|
|
38
|
-
}>(option: T | boolean | undefined, alias: T["alias"]) => T | false;
|
|
39
|
-
declare const ensurePCSSOption: <T>(option: T | string, type: PCSSOption, cwd: string, logger: RollupLogger) => Promise<T>;
|
|
40
|
-
declare const ensurePCSSPlugins: (plugins: PostCSSOptions["plugins"], cwd: string, logger: RollupLogger) => Promise<Result["plugins"]>;
|
|
41
|
-
type OptionType<T, TDefine extends T | boolean | undefined> = T | TDefine | false;
|
|
42
|
-
|
|
43
|
-
declare const resolve: (ids: string[], userOptions: ResolveOptions) => string;
|
|
44
|
-
interface ResolveOptions extends NapiResolveOptions {
|
|
45
|
-
baseDirs?: string[];
|
|
46
|
-
caller?: string;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
declare const safeId: (id: string, ...salt: string[]) => string;
|
|
50
|
-
|
|
51
|
-
declare class MapModifier {
|
|
52
|
-
private readonly map?;
|
|
53
|
-
constructor(map?: RawSourceMap | string);
|
|
54
|
-
modify(f: (m: RawSourceMap) => void): this;
|
|
55
|
-
modifySources(op: (source: string) => string): this;
|
|
56
|
-
resolve(directory?: string): this;
|
|
57
|
-
relative(directory?: string): this;
|
|
58
|
-
toObject(): RawSourceMap | undefined;
|
|
59
|
-
toString(): string | undefined;
|
|
60
|
-
toConsumer(): SourceMapConsumer | undefined;
|
|
61
|
-
toCommentData(): string;
|
|
62
|
-
toCommentFile(fileName: string): string;
|
|
63
|
-
}
|
|
64
|
-
declare const getMap: (code: string, id?: string) => Promise<string | undefined>;
|
|
65
|
-
declare const stripMap: (code: string) => string;
|
|
66
|
-
declare const mm: (map?: RawSourceMap | string) => MapModifier;
|
|
67
|
-
|
|
68
|
-
declare const hasModuleSpecifier: (url: string) => boolean;
|
|
69
|
-
declare const getUrlOfPartial: (url: string) => string;
|
|
70
|
-
declare const normalizeUrl: (url: string) => string;
|
|
71
|
-
|
|
72
|
-
export { arrayFmt, concat, ensurePCSSOption, ensurePCSSPlugins, getMap, getUrlOfPartial, hasModuleSpecifier, inferHandlerOption, inferModeOption, inferOption, inferSourceMapOption, loadModule, mm, normalizeUrl, resolve, safeId, stripMap };
|
|
73
|
-
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-fAc592HP.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
|