extension-develop 3.0.0-next.39 → 3.0.0-next.40
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/dist/41.js +6330 -0
- package/dist/721.js +4880 -0
- package/dist/764.js +6188 -0
- package/dist/859.js +93 -0
- package/dist/module.js +681 -18
- package/dist/module.js.LICENSE.txt +13 -0
- package/package.json +1 -1
package/dist/module.js
CHANGED
|
@@ -1,7 +1,329 @@
|
|
|
1
|
+
/*! For license information please see module.js.LICENSE.txt */
|
|
1
2
|
const __rslib_import_meta_url__ = /*#__PURE__*/ function() {
|
|
2
3
|
return 'undefined' == typeof document ? new (require('url'.replace('', ''))).URL('file:' + __filename).href : document.currentScript && document.currentScript.src || new URL('main.js', document.baseURI).href;
|
|
3
4
|
}();
|
|
4
5
|
var __webpack_modules__ = {
|
|
6
|
+
"../../node_modules/.pnpm/lilconfig@3.1.3/node_modules/lilconfig/src/index.js": function(module, __unused_webpack_exports, __webpack_require__) {
|
|
7
|
+
const path = __webpack_require__("path");
|
|
8
|
+
const fs = __webpack_require__("fs");
|
|
9
|
+
const os = __webpack_require__("os");
|
|
10
|
+
const url = __webpack_require__("url");
|
|
11
|
+
const fsReadFileAsync = fs.promises.readFile;
|
|
12
|
+
function getDefaultSearchPlaces(name, sync) {
|
|
13
|
+
return [
|
|
14
|
+
'package.json',
|
|
15
|
+
`.${name}rc.json`,
|
|
16
|
+
`.${name}rc.js`,
|
|
17
|
+
`.${name}rc.cjs`,
|
|
18
|
+
...sync ? [] : [
|
|
19
|
+
`.${name}rc.mjs`
|
|
20
|
+
],
|
|
21
|
+
`.config/${name}rc`,
|
|
22
|
+
`.config/${name}rc.json`,
|
|
23
|
+
`.config/${name}rc.js`,
|
|
24
|
+
`.config/${name}rc.cjs`,
|
|
25
|
+
...sync ? [] : [
|
|
26
|
+
`.config/${name}rc.mjs`
|
|
27
|
+
],
|
|
28
|
+
`${name}.config.js`,
|
|
29
|
+
`${name}.config.cjs`,
|
|
30
|
+
...sync ? [] : [
|
|
31
|
+
`${name}.config.mjs`
|
|
32
|
+
]
|
|
33
|
+
];
|
|
34
|
+
}
|
|
35
|
+
function parentDir(p) {
|
|
36
|
+
return path.dirname(p) || path.sep;
|
|
37
|
+
}
|
|
38
|
+
const jsonLoader = (_, content)=>JSON.parse(content);
|
|
39
|
+
const requireFunc = require;
|
|
40
|
+
const defaultLoadersSync = Object.freeze({
|
|
41
|
+
'.js': requireFunc,
|
|
42
|
+
'.json': requireFunc,
|
|
43
|
+
'.cjs': requireFunc,
|
|
44
|
+
noExt: jsonLoader
|
|
45
|
+
});
|
|
46
|
+
module.exports.defaultLoadersSync = defaultLoadersSync;
|
|
47
|
+
const dynamicImport = async (id)=>{
|
|
48
|
+
try {
|
|
49
|
+
const fileUrl = url.pathToFileURL(id).href;
|
|
50
|
+
const mod = await import(fileUrl);
|
|
51
|
+
return mod.default;
|
|
52
|
+
} catch (e) {
|
|
53
|
+
try {
|
|
54
|
+
return requireFunc(id);
|
|
55
|
+
} catch (requireE) {
|
|
56
|
+
if ('ERR_REQUIRE_ESM' === requireE.code || requireE instanceof SyntaxError && requireE.toString().includes('Cannot use import statement outside a module')) throw e;
|
|
57
|
+
throw requireE;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
const defaultLoaders = Object.freeze({
|
|
62
|
+
'.js': dynamicImport,
|
|
63
|
+
'.mjs': dynamicImport,
|
|
64
|
+
'.cjs': dynamicImport,
|
|
65
|
+
'.json': jsonLoader,
|
|
66
|
+
noExt: jsonLoader
|
|
67
|
+
});
|
|
68
|
+
module.exports.defaultLoaders = defaultLoaders;
|
|
69
|
+
function getOptions(name, options, sync) {
|
|
70
|
+
const conf = {
|
|
71
|
+
stopDir: os.homedir(),
|
|
72
|
+
searchPlaces: getDefaultSearchPlaces(name, sync),
|
|
73
|
+
ignoreEmptySearchPlaces: true,
|
|
74
|
+
cache: true,
|
|
75
|
+
transform: (x)=>x,
|
|
76
|
+
packageProp: [
|
|
77
|
+
name
|
|
78
|
+
],
|
|
79
|
+
...options,
|
|
80
|
+
loaders: {
|
|
81
|
+
...sync ? defaultLoadersSync : defaultLoaders,
|
|
82
|
+
...options.loaders
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
conf.searchPlaces.forEach((place)=>{
|
|
86
|
+
const key = path.extname(place) || 'noExt';
|
|
87
|
+
const loader = conf.loaders[key];
|
|
88
|
+
if (!loader) throw new Error(`Missing loader for extension "${place}"`);
|
|
89
|
+
if ('function' != typeof loader) throw new Error(`Loader for extension "${place}" is not a function: Received ${typeof loader}.`);
|
|
90
|
+
});
|
|
91
|
+
return conf;
|
|
92
|
+
}
|
|
93
|
+
function getPackageProp(props, obj) {
|
|
94
|
+
if ('string' == typeof props && props in obj) return obj[props];
|
|
95
|
+
return (Array.isArray(props) ? props : props.split('.')).reduce((acc, prop)=>void 0 === acc ? acc : acc[prop], obj) || null;
|
|
96
|
+
}
|
|
97
|
+
function validateFilePath(filepath) {
|
|
98
|
+
if (!filepath) throw new Error('load must pass a non-empty string');
|
|
99
|
+
}
|
|
100
|
+
function validateLoader(loader, ext) {
|
|
101
|
+
if (!loader) throw new Error(`No loader specified for extension "${ext}"`);
|
|
102
|
+
if ('function' != typeof loader) throw new Error('loader is not a function');
|
|
103
|
+
}
|
|
104
|
+
const makeEmplace = (enableCache)=>(c, filepath, res)=>{
|
|
105
|
+
if (enableCache) c.set(filepath, res);
|
|
106
|
+
return res;
|
|
107
|
+
};
|
|
108
|
+
module.exports.lilconfig = function(name, options) {
|
|
109
|
+
const { ignoreEmptySearchPlaces, loaders, packageProp, searchPlaces, stopDir, transform, cache } = getOptions(name, options ?? {}, false);
|
|
110
|
+
const searchCache = new Map();
|
|
111
|
+
const loadCache = new Map();
|
|
112
|
+
const emplace = makeEmplace(cache);
|
|
113
|
+
return {
|
|
114
|
+
async search (searchFrom = process.cwd()) {
|
|
115
|
+
const result = {
|
|
116
|
+
config: null,
|
|
117
|
+
filepath: ''
|
|
118
|
+
};
|
|
119
|
+
const visited = new Set();
|
|
120
|
+
let dir = searchFrom;
|
|
121
|
+
dirLoop: while(true){
|
|
122
|
+
if (cache) {
|
|
123
|
+
const r = searchCache.get(dir);
|
|
124
|
+
if (void 0 !== r) {
|
|
125
|
+
for (const p of visited)searchCache.set(p, r);
|
|
126
|
+
return r;
|
|
127
|
+
}
|
|
128
|
+
visited.add(dir);
|
|
129
|
+
}
|
|
130
|
+
for (const searchPlace of searchPlaces){
|
|
131
|
+
const filepath = path.join(dir, searchPlace);
|
|
132
|
+
try {
|
|
133
|
+
await fs.promises.access(filepath);
|
|
134
|
+
} catch {
|
|
135
|
+
continue;
|
|
136
|
+
}
|
|
137
|
+
const content = String(await fsReadFileAsync(filepath));
|
|
138
|
+
const loaderKey = path.extname(searchPlace) || 'noExt';
|
|
139
|
+
const loader = loaders[loaderKey];
|
|
140
|
+
if ('package.json' === searchPlace) {
|
|
141
|
+
const pkg = await loader(filepath, content);
|
|
142
|
+
const maybeConfig = getPackageProp(packageProp, pkg);
|
|
143
|
+
if (null != maybeConfig) {
|
|
144
|
+
result.config = maybeConfig;
|
|
145
|
+
result.filepath = filepath;
|
|
146
|
+
break dirLoop;
|
|
147
|
+
}
|
|
148
|
+
continue;
|
|
149
|
+
}
|
|
150
|
+
const isEmpty = '' === content.trim();
|
|
151
|
+
if (!isEmpty || !ignoreEmptySearchPlaces) {
|
|
152
|
+
if (isEmpty) {
|
|
153
|
+
result.isEmpty = true;
|
|
154
|
+
result.config = void 0;
|
|
155
|
+
} else {
|
|
156
|
+
validateLoader(loader, loaderKey);
|
|
157
|
+
result.config = await loader(filepath, content);
|
|
158
|
+
}
|
|
159
|
+
result.filepath = filepath;
|
|
160
|
+
break dirLoop;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
if (dir === stopDir || dir === parentDir(dir)) break;
|
|
164
|
+
dir = parentDir(dir);
|
|
165
|
+
}
|
|
166
|
+
const transformed = '' === result.filepath && null === result.config ? transform(null) : transform(result);
|
|
167
|
+
if (cache) for (const p of visited)searchCache.set(p, transformed);
|
|
168
|
+
return transformed;
|
|
169
|
+
},
|
|
170
|
+
async load (filepath) {
|
|
171
|
+
validateFilePath(filepath);
|
|
172
|
+
const absPath = path.resolve(process.cwd(), filepath);
|
|
173
|
+
if (cache && loadCache.has(absPath)) return loadCache.get(absPath);
|
|
174
|
+
const { base, ext } = path.parse(absPath);
|
|
175
|
+
const loaderKey = ext || 'noExt';
|
|
176
|
+
const loader = loaders[loaderKey];
|
|
177
|
+
validateLoader(loader, loaderKey);
|
|
178
|
+
const content = String(await fsReadFileAsync(absPath));
|
|
179
|
+
if ('package.json' === base) {
|
|
180
|
+
const pkg = await loader(absPath, content);
|
|
181
|
+
return emplace(loadCache, absPath, transform({
|
|
182
|
+
config: getPackageProp(packageProp, pkg),
|
|
183
|
+
filepath: absPath
|
|
184
|
+
}));
|
|
185
|
+
}
|
|
186
|
+
const result = {
|
|
187
|
+
config: null,
|
|
188
|
+
filepath: absPath
|
|
189
|
+
};
|
|
190
|
+
const isEmpty = '' === content.trim();
|
|
191
|
+
if (isEmpty && ignoreEmptySearchPlaces) return emplace(loadCache, absPath, transform({
|
|
192
|
+
config: void 0,
|
|
193
|
+
filepath: absPath,
|
|
194
|
+
isEmpty: true
|
|
195
|
+
}));
|
|
196
|
+
result.config = isEmpty ? void 0 : await loader(absPath, content);
|
|
197
|
+
return emplace(loadCache, absPath, transform(isEmpty ? {
|
|
198
|
+
...result,
|
|
199
|
+
isEmpty,
|
|
200
|
+
config: void 0
|
|
201
|
+
} : result));
|
|
202
|
+
},
|
|
203
|
+
clearLoadCache () {
|
|
204
|
+
if (cache) loadCache.clear();
|
|
205
|
+
},
|
|
206
|
+
clearSearchCache () {
|
|
207
|
+
if (cache) searchCache.clear();
|
|
208
|
+
},
|
|
209
|
+
clearCaches () {
|
|
210
|
+
if (cache) {
|
|
211
|
+
loadCache.clear();
|
|
212
|
+
searchCache.clear();
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
};
|
|
216
|
+
};
|
|
217
|
+
module.exports.lilconfigSync = function(name, options) {
|
|
218
|
+
const { ignoreEmptySearchPlaces, loaders, packageProp, searchPlaces, stopDir, transform, cache } = getOptions(name, options ?? {}, true);
|
|
219
|
+
const searchCache = new Map();
|
|
220
|
+
const loadCache = new Map();
|
|
221
|
+
const emplace = makeEmplace(cache);
|
|
222
|
+
return {
|
|
223
|
+
search (searchFrom = process.cwd()) {
|
|
224
|
+
const result = {
|
|
225
|
+
config: null,
|
|
226
|
+
filepath: ''
|
|
227
|
+
};
|
|
228
|
+
const visited = new Set();
|
|
229
|
+
let dir = searchFrom;
|
|
230
|
+
dirLoop: while(true){
|
|
231
|
+
if (cache) {
|
|
232
|
+
const r = searchCache.get(dir);
|
|
233
|
+
if (void 0 !== r) {
|
|
234
|
+
for (const p of visited)searchCache.set(p, r);
|
|
235
|
+
return r;
|
|
236
|
+
}
|
|
237
|
+
visited.add(dir);
|
|
238
|
+
}
|
|
239
|
+
for (const searchPlace of searchPlaces){
|
|
240
|
+
const filepath = path.join(dir, searchPlace);
|
|
241
|
+
try {
|
|
242
|
+
fs.accessSync(filepath);
|
|
243
|
+
} catch {
|
|
244
|
+
continue;
|
|
245
|
+
}
|
|
246
|
+
const loaderKey = path.extname(searchPlace) || 'noExt';
|
|
247
|
+
const loader = loaders[loaderKey];
|
|
248
|
+
const content = String(fs.readFileSync(filepath));
|
|
249
|
+
if ('package.json' === searchPlace) {
|
|
250
|
+
const pkg = loader(filepath, content);
|
|
251
|
+
const maybeConfig = getPackageProp(packageProp, pkg);
|
|
252
|
+
if (null != maybeConfig) {
|
|
253
|
+
result.config = maybeConfig;
|
|
254
|
+
result.filepath = filepath;
|
|
255
|
+
break dirLoop;
|
|
256
|
+
}
|
|
257
|
+
continue;
|
|
258
|
+
}
|
|
259
|
+
const isEmpty = '' === content.trim();
|
|
260
|
+
if (!isEmpty || !ignoreEmptySearchPlaces) {
|
|
261
|
+
if (isEmpty) {
|
|
262
|
+
result.isEmpty = true;
|
|
263
|
+
result.config = void 0;
|
|
264
|
+
} else {
|
|
265
|
+
validateLoader(loader, loaderKey);
|
|
266
|
+
result.config = loader(filepath, content);
|
|
267
|
+
}
|
|
268
|
+
result.filepath = filepath;
|
|
269
|
+
break dirLoop;
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
if (dir === stopDir || dir === parentDir(dir)) break;
|
|
273
|
+
dir = parentDir(dir);
|
|
274
|
+
}
|
|
275
|
+
const transformed = '' === result.filepath && null === result.config ? transform(null) : transform(result);
|
|
276
|
+
if (cache) for (const p of visited)searchCache.set(p, transformed);
|
|
277
|
+
return transformed;
|
|
278
|
+
},
|
|
279
|
+
load (filepath) {
|
|
280
|
+
validateFilePath(filepath);
|
|
281
|
+
const absPath = path.resolve(process.cwd(), filepath);
|
|
282
|
+
if (cache && loadCache.has(absPath)) return loadCache.get(absPath);
|
|
283
|
+
const { base, ext } = path.parse(absPath);
|
|
284
|
+
const loaderKey = ext || 'noExt';
|
|
285
|
+
const loader = loaders[loaderKey];
|
|
286
|
+
validateLoader(loader, loaderKey);
|
|
287
|
+
const content = String(fs.readFileSync(absPath));
|
|
288
|
+
if ('package.json' === base) {
|
|
289
|
+
const pkg = loader(absPath, content);
|
|
290
|
+
return transform({
|
|
291
|
+
config: getPackageProp(packageProp, pkg),
|
|
292
|
+
filepath: absPath
|
|
293
|
+
});
|
|
294
|
+
}
|
|
295
|
+
const result = {
|
|
296
|
+
config: null,
|
|
297
|
+
filepath: absPath
|
|
298
|
+
};
|
|
299
|
+
const isEmpty = '' === content.trim();
|
|
300
|
+
if (isEmpty && ignoreEmptySearchPlaces) return emplace(loadCache, absPath, transform({
|
|
301
|
+
filepath: absPath,
|
|
302
|
+
config: void 0,
|
|
303
|
+
isEmpty: true
|
|
304
|
+
}));
|
|
305
|
+
result.config = isEmpty ? void 0 : loader(absPath, content);
|
|
306
|
+
return emplace(loadCache, absPath, transform(isEmpty ? {
|
|
307
|
+
...result,
|
|
308
|
+
isEmpty,
|
|
309
|
+
config: void 0
|
|
310
|
+
} : result));
|
|
311
|
+
},
|
|
312
|
+
clearLoadCache () {
|
|
313
|
+
if (cache) loadCache.clear();
|
|
314
|
+
},
|
|
315
|
+
clearSearchCache () {
|
|
316
|
+
if (cache) searchCache.clear();
|
|
317
|
+
},
|
|
318
|
+
clearCaches () {
|
|
319
|
+
if (cache) {
|
|
320
|
+
loadCache.clear();
|
|
321
|
+
searchCache.clear();
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
};
|
|
325
|
+
};
|
|
326
|
+
},
|
|
5
327
|
"../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js": function(module) {
|
|
6
328
|
let p = process || {}, argv = p.argv || [], env = p.env || {};
|
|
7
329
|
let isColorSupported = !(!!env.NO_COLOR || argv.includes("--no-color")) && (!!env.FORCE_COLOR || argv.includes("--color") || "win32" === p.platform || (p.stdout || {}).isTTY && "dumb" !== env.TERM || !!env.CI);
|
|
@@ -68,6 +390,191 @@ var __webpack_modules__ = {
|
|
|
68
390
|
module.exports = createColors();
|
|
69
391
|
module.exports.createColors = createColors;
|
|
70
392
|
},
|
|
393
|
+
"../../node_modules/.pnpm/postcss-load-config@6.0.1_jiti@2.6.1_postcss@8.5.6_tsx@4.21.0_yaml@2.8.1/node_modules/postcss-load-config/src/index.js": function(module, __unused_webpack_exports, __webpack_require__) {
|
|
394
|
+
const { resolve } = __webpack_require__("node:path");
|
|
395
|
+
const config = __webpack_require__("../../node_modules/.pnpm/lilconfig@3.1.3/node_modules/lilconfig/src/index.js");
|
|
396
|
+
const loadOptions = __webpack_require__("../../node_modules/.pnpm/postcss-load-config@6.0.1_jiti@2.6.1_postcss@8.5.6_tsx@4.21.0_yaml@2.8.1/node_modules/postcss-load-config/src/options.js");
|
|
397
|
+
const loadPlugins = __webpack_require__("../../node_modules/.pnpm/postcss-load-config@6.0.1_jiti@2.6.1_postcss@8.5.6_tsx@4.21.0_yaml@2.8.1/node_modules/postcss-load-config/src/plugins.js");
|
|
398
|
+
const req = __webpack_require__("../../node_modules/.pnpm/postcss-load-config@6.0.1_jiti@2.6.1_postcss@8.5.6_tsx@4.21.0_yaml@2.8.1/node_modules/postcss-load-config/src/req.js");
|
|
399
|
+
const interopRequireDefault = (obj)=>obj && obj.__esModule ? obj : {
|
|
400
|
+
default: obj
|
|
401
|
+
};
|
|
402
|
+
async function processResult(ctx, result) {
|
|
403
|
+
let file = result.filepath || '';
|
|
404
|
+
let projectConfig = interopRequireDefault(result.config).default || {};
|
|
405
|
+
projectConfig = 'function' == typeof projectConfig ? projectConfig(ctx) : Object.assign({}, projectConfig, ctx);
|
|
406
|
+
if (!projectConfig.plugins) projectConfig.plugins = [];
|
|
407
|
+
let res = {
|
|
408
|
+
file,
|
|
409
|
+
options: await loadOptions(projectConfig, file),
|
|
410
|
+
plugins: await loadPlugins(projectConfig, file)
|
|
411
|
+
};
|
|
412
|
+
delete projectConfig.plugins;
|
|
413
|
+
return res;
|
|
414
|
+
}
|
|
415
|
+
function createContext(ctx) {
|
|
416
|
+
ctx = Object.assign({
|
|
417
|
+
cwd: process.cwd(),
|
|
418
|
+
env: process.env.NODE_ENV
|
|
419
|
+
}, ctx);
|
|
420
|
+
if (!ctx.env) process.env.NODE_ENV = 'development';
|
|
421
|
+
return ctx;
|
|
422
|
+
}
|
|
423
|
+
async function loader(filepath) {
|
|
424
|
+
return req(filepath);
|
|
425
|
+
}
|
|
426
|
+
let yaml;
|
|
427
|
+
async function yamlLoader(_, content) {
|
|
428
|
+
if (!yaml) try {
|
|
429
|
+
yaml = await __webpack_require__.e("41").then(__webpack_require__.t.bind(__webpack_require__, "../../node_modules/.pnpm/yaml@2.8.1/node_modules/yaml/dist/index.js", 19));
|
|
430
|
+
} catch (e) {
|
|
431
|
+
throw new Error(`'yaml' is required for the YAML configuration files. Make sure it is installed\nError: ${e.message}`);
|
|
432
|
+
}
|
|
433
|
+
return yaml.parse(content);
|
|
434
|
+
}
|
|
435
|
+
const withLoaders = (options = {})=>{
|
|
436
|
+
let moduleName = 'postcss';
|
|
437
|
+
return {
|
|
438
|
+
...options,
|
|
439
|
+
loaders: {
|
|
440
|
+
...options.loaders,
|
|
441
|
+
'.cjs': loader,
|
|
442
|
+
'.cts': loader,
|
|
443
|
+
'.js': loader,
|
|
444
|
+
'.mjs': loader,
|
|
445
|
+
'.mts': loader,
|
|
446
|
+
'.ts': loader,
|
|
447
|
+
'.yaml': yamlLoader,
|
|
448
|
+
'.yml': yamlLoader
|
|
449
|
+
},
|
|
450
|
+
searchPlaces: [
|
|
451
|
+
...options.searchPlaces || [],
|
|
452
|
+
'package.json',
|
|
453
|
+
`.${moduleName}rc`,
|
|
454
|
+
`.${moduleName}rc.json`,
|
|
455
|
+
`.${moduleName}rc.yaml`,
|
|
456
|
+
`.${moduleName}rc.yml`,
|
|
457
|
+
`.${moduleName}rc.ts`,
|
|
458
|
+
`.${moduleName}rc.cts`,
|
|
459
|
+
`.${moduleName}rc.mts`,
|
|
460
|
+
`.${moduleName}rc.js`,
|
|
461
|
+
`.${moduleName}rc.cjs`,
|
|
462
|
+
`.${moduleName}rc.mjs`,
|
|
463
|
+
`${moduleName}.config.ts`,
|
|
464
|
+
`${moduleName}.config.cts`,
|
|
465
|
+
`${moduleName}.config.mts`,
|
|
466
|
+
`${moduleName}.config.js`,
|
|
467
|
+
`${moduleName}.config.cjs`,
|
|
468
|
+
`${moduleName}.config.mjs`
|
|
469
|
+
]
|
|
470
|
+
};
|
|
471
|
+
};
|
|
472
|
+
function rc(ctx, path, options) {
|
|
473
|
+
ctx = createContext(ctx);
|
|
474
|
+
path = path ? resolve(path) : process.cwd();
|
|
475
|
+
return config.lilconfig('postcss', withLoaders(options)).search(path).then((result)=>{
|
|
476
|
+
if (!result) throw new Error(`No PostCSS Config found in: ${path}`);
|
|
477
|
+
return processResult(ctx, result);
|
|
478
|
+
});
|
|
479
|
+
}
|
|
480
|
+
/**
|
|
481
|
+
* Autoload Config for PostCSS
|
|
482
|
+
*
|
|
483
|
+
* @author Michael Ciniawsky @michael-ciniawsky <michael.ciniawsky@gmail.com>
|
|
484
|
+
* @license MIT
|
|
485
|
+
*
|
|
486
|
+
* @module postcss-load-config
|
|
487
|
+
* @version 2.1.0
|
|
488
|
+
*
|
|
489
|
+
* @requires comsiconfig
|
|
490
|
+
* @requires ./options
|
|
491
|
+
* @requires ./plugins
|
|
492
|
+
*/ module.exports = rc;
|
|
493
|
+
},
|
|
494
|
+
"../../node_modules/.pnpm/postcss-load-config@6.0.1_jiti@2.6.1_postcss@8.5.6_tsx@4.21.0_yaml@2.8.1/node_modules/postcss-load-config/src/options.js": function(module, __unused_webpack_exports, __webpack_require__) {
|
|
495
|
+
const req = __webpack_require__("../../node_modules/.pnpm/postcss-load-config@6.0.1_jiti@2.6.1_postcss@8.5.6_tsx@4.21.0_yaml@2.8.1/node_modules/postcss-load-config/src/req.js");
|
|
496
|
+
async function options(config, file) {
|
|
497
|
+
if (config.parser && 'string' == typeof config.parser) try {
|
|
498
|
+
config.parser = await req(config.parser, file);
|
|
499
|
+
} catch (err) {
|
|
500
|
+
throw new Error(`Loading PostCSS Parser failed: ${err.message}\n\n(@${file})`);
|
|
501
|
+
}
|
|
502
|
+
if (config.syntax && 'string' == typeof config.syntax) try {
|
|
503
|
+
config.syntax = await req(config.syntax, file);
|
|
504
|
+
} catch (err) {
|
|
505
|
+
throw new Error(`Loading PostCSS Syntax failed: ${err.message}\n\n(@${file})`);
|
|
506
|
+
}
|
|
507
|
+
if (config.stringifier && 'string' == typeof config.stringifier) try {
|
|
508
|
+
config.stringifier = await req(config.stringifier, file);
|
|
509
|
+
} catch (err) {
|
|
510
|
+
throw new Error(`Loading PostCSS Stringifier failed: ${err.message}\n\n(@${file})`);
|
|
511
|
+
}
|
|
512
|
+
return config;
|
|
513
|
+
}
|
|
514
|
+
module.exports = options;
|
|
515
|
+
},
|
|
516
|
+
"../../node_modules/.pnpm/postcss-load-config@6.0.1_jiti@2.6.1_postcss@8.5.6_tsx@4.21.0_yaml@2.8.1/node_modules/postcss-load-config/src/plugins.js": function(module, __unused_webpack_exports, __webpack_require__) {
|
|
517
|
+
const req = __webpack_require__("../../node_modules/.pnpm/postcss-load-config@6.0.1_jiti@2.6.1_postcss@8.5.6_tsx@4.21.0_yaml@2.8.1/node_modules/postcss-load-config/src/req.js");
|
|
518
|
+
async function load(plugin, options, file) {
|
|
519
|
+
try {
|
|
520
|
+
if (null == options || 0 === Object.keys(options).length) return await req(plugin, file);
|
|
521
|
+
return (await req(plugin, file))(options);
|
|
522
|
+
} catch (err) {
|
|
523
|
+
throw new Error(`Loading PostCSS Plugin failed: ${err.message}\n\n(@${file})`);
|
|
524
|
+
}
|
|
525
|
+
}
|
|
526
|
+
async function plugins(config, file) {
|
|
527
|
+
let list = [];
|
|
528
|
+
if (Array.isArray(config.plugins)) list = config.plugins.filter(Boolean);
|
|
529
|
+
else {
|
|
530
|
+
list = Object.entries(config.plugins).filter(([, options])=>false !== options).map(([plugin, options])=>load(plugin, options, file));
|
|
531
|
+
list = await Promise.all(list);
|
|
532
|
+
}
|
|
533
|
+
if (list.length && list.length > 0) list.forEach((plugin, i)=>{
|
|
534
|
+
if (plugin.default) plugin = plugin.default;
|
|
535
|
+
if (true === plugin.postcss) plugin = plugin();
|
|
536
|
+
else if (plugin.postcss) plugin = plugin.postcss;
|
|
537
|
+
if (!('object' == typeof plugin && Array.isArray(plugin.plugins) || 'object' == typeof plugin && plugin.postcssPlugin || 'function' == typeof plugin)) throw new TypeError(`Invalid PostCSS Plugin found at: plugins[${i}]\n\n(@${file})`);
|
|
538
|
+
});
|
|
539
|
+
return list;
|
|
540
|
+
}
|
|
541
|
+
module.exports = plugins;
|
|
542
|
+
},
|
|
543
|
+
"../../node_modules/.pnpm/postcss-load-config@6.0.1_jiti@2.6.1_postcss@8.5.6_tsx@4.21.0_yaml@2.8.1/node_modules/postcss-load-config/src/req.js": function(module, __unused_webpack_exports, __webpack_require__) {
|
|
544
|
+
const { createRequire } = __webpack_require__("node:module");
|
|
545
|
+
const { pathToFileURL } = __webpack_require__("node:url");
|
|
546
|
+
const TS_EXT_RE = /\.[mc]?ts$/;
|
|
547
|
+
let tsx;
|
|
548
|
+
let jiti;
|
|
549
|
+
let importError = [];
|
|
550
|
+
async function req(name, rootFile = __filename) {
|
|
551
|
+
let url = createRequire(rootFile).resolve(name);
|
|
552
|
+
try {
|
|
553
|
+
return (await import(`${pathToFileURL(url)}?t=${Date.now()}`)).default;
|
|
554
|
+
} catch (err) {
|
|
555
|
+
if (!TS_EXT_RE.test(url)) throw err;
|
|
556
|
+
}
|
|
557
|
+
if (void 0 === tsx) try {
|
|
558
|
+
tsx = await __webpack_require__.e("764").then(__webpack_require__.bind(__webpack_require__, "../../node_modules/.pnpm/tsx@4.21.0/node_modules/tsx/dist/cjs/api/index.mjs"));
|
|
559
|
+
} catch (error) {
|
|
560
|
+
importError.push(error);
|
|
561
|
+
}
|
|
562
|
+
if (tsx) {
|
|
563
|
+
let loaded = tsx.require(name, rootFile);
|
|
564
|
+
return loaded && '__esModule' in loaded ? loaded.default : loaded;
|
|
565
|
+
}
|
|
566
|
+
if (void 0 === jiti) try {
|
|
567
|
+
jiti = (await __webpack_require__.e("721").then(__webpack_require__.bind(__webpack_require__, "../../node_modules/.pnpm/jiti@2.6.1/node_modules/jiti/lib/jiti.mjs"))).default;
|
|
568
|
+
} catch (error) {
|
|
569
|
+
importError.push(error);
|
|
570
|
+
}
|
|
571
|
+
if (jiti) return jiti(rootFile, {
|
|
572
|
+
interopDefault: true
|
|
573
|
+
})(name);
|
|
574
|
+
throw new Error(`'tsx' or 'jiti' is required for the TypeScript configuration files. Make sure it is installed\nError: ${importError.map((error)=>error.message).join('\n')}`);
|
|
575
|
+
}
|
|
576
|
+
module.exports = req;
|
|
577
|
+
},
|
|
71
578
|
"../../node_modules/.pnpm/postcss@8.5.6/node_modules/postcss/lib/at-rule.js": function(module, __unused_webpack_exports, __webpack_require__) {
|
|
72
579
|
"use strict";
|
|
73
580
|
let Container = __webpack_require__("../../node_modules/.pnpm/postcss@8.5.6/node_modules/postcss/lib/container.js");
|
|
@@ -5029,6 +5536,10 @@ var __webpack_modules__ = {
|
|
|
5029
5536
|
"use strict";
|
|
5030
5537
|
module.exports = require("adm-zip");
|
|
5031
5538
|
},
|
|
5539
|
+
buffer: function(module) {
|
|
5540
|
+
"use strict";
|
|
5541
|
+
module.exports = require("buffer");
|
|
5542
|
+
},
|
|
5032
5543
|
child_process: function(module) {
|
|
5033
5544
|
"use strict";
|
|
5034
5545
|
module.exports = require("child_process");
|
|
@@ -5057,6 +5568,70 @@ var __webpack_modules__ = {
|
|
|
5057
5568
|
"use strict";
|
|
5058
5569
|
module.exports = require("fs");
|
|
5059
5570
|
},
|
|
5571
|
+
module: function(module) {
|
|
5572
|
+
"use strict";
|
|
5573
|
+
module.exports = require("module");
|
|
5574
|
+
},
|
|
5575
|
+
"node:assert": function(module) {
|
|
5576
|
+
"use strict";
|
|
5577
|
+
module.exports = require("node:assert");
|
|
5578
|
+
},
|
|
5579
|
+
"node:crypto": function(module) {
|
|
5580
|
+
"use strict";
|
|
5581
|
+
module.exports = require("node:crypto");
|
|
5582
|
+
},
|
|
5583
|
+
"node:fs": function(module) {
|
|
5584
|
+
"use strict";
|
|
5585
|
+
module.exports = require("node:fs");
|
|
5586
|
+
},
|
|
5587
|
+
"node:module": function(module) {
|
|
5588
|
+
"use strict";
|
|
5589
|
+
module.exports = require("node:module");
|
|
5590
|
+
},
|
|
5591
|
+
"node:net": function(module) {
|
|
5592
|
+
"use strict";
|
|
5593
|
+
module.exports = require("node:net");
|
|
5594
|
+
},
|
|
5595
|
+
"node:os": function(module) {
|
|
5596
|
+
"use strict";
|
|
5597
|
+
module.exports = require("node:os");
|
|
5598
|
+
},
|
|
5599
|
+
"node:path": function(module) {
|
|
5600
|
+
"use strict";
|
|
5601
|
+
module.exports = require("node:path");
|
|
5602
|
+
},
|
|
5603
|
+
"node:perf_hooks": function(module) {
|
|
5604
|
+
"use strict";
|
|
5605
|
+
module.exports = require("node:perf_hooks");
|
|
5606
|
+
},
|
|
5607
|
+
"node:process": function(module) {
|
|
5608
|
+
"use strict";
|
|
5609
|
+
module.exports = require("node:process");
|
|
5610
|
+
},
|
|
5611
|
+
"node:tty": function(module) {
|
|
5612
|
+
"use strict";
|
|
5613
|
+
module.exports = require("node:tty");
|
|
5614
|
+
},
|
|
5615
|
+
"node:url": function(module) {
|
|
5616
|
+
"use strict";
|
|
5617
|
+
module.exports = require("node:url");
|
|
5618
|
+
},
|
|
5619
|
+
"node:util": function(module) {
|
|
5620
|
+
"use strict";
|
|
5621
|
+
module.exports = require("node:util");
|
|
5622
|
+
},
|
|
5623
|
+
"node:v8": function(module) {
|
|
5624
|
+
"use strict";
|
|
5625
|
+
module.exports = require("node:v8");
|
|
5626
|
+
},
|
|
5627
|
+
"node:vm": function(module) {
|
|
5628
|
+
"use strict";
|
|
5629
|
+
module.exports = require("node:vm");
|
|
5630
|
+
},
|
|
5631
|
+
os: function(module) {
|
|
5632
|
+
"use strict";
|
|
5633
|
+
module.exports = require("os");
|
|
5634
|
+
},
|
|
5060
5635
|
"package-manager-detector": function(module) {
|
|
5061
5636
|
"use strict";
|
|
5062
5637
|
module.exports = require("package-manager-detector");
|
|
@@ -5069,10 +5644,26 @@ var __webpack_modules__ = {
|
|
|
5069
5644
|
"use strict";
|
|
5070
5645
|
module.exports = require("pintor");
|
|
5071
5646
|
},
|
|
5647
|
+
pnpapi: function(module) {
|
|
5648
|
+
"use strict";
|
|
5649
|
+
module.exports = require("pnpapi");
|
|
5650
|
+
},
|
|
5651
|
+
process: function(module) {
|
|
5652
|
+
"use strict";
|
|
5653
|
+
module.exports = require("process");
|
|
5654
|
+
},
|
|
5655
|
+
tty: function(module) {
|
|
5656
|
+
"use strict";
|
|
5657
|
+
module.exports = require("tty");
|
|
5658
|
+
},
|
|
5072
5659
|
url: function(module) {
|
|
5073
5660
|
"use strict";
|
|
5074
5661
|
module.exports = require("url");
|
|
5075
5662
|
},
|
|
5663
|
+
worker_threads: function(module) {
|
|
5664
|
+
"use strict";
|
|
5665
|
+
module.exports = require("worker_threads");
|
|
5666
|
+
},
|
|
5076
5667
|
"go-git-it": function(module) {
|
|
5077
5668
|
"use strict";
|
|
5078
5669
|
module.exports = import("go-git-it").then(function(module) {
|
|
@@ -5100,7 +5691,7 @@ var __webpack_modules__ = {
|
|
|
5100
5691
|
},
|
|
5101
5692
|
"./package.json": function(module) {
|
|
5102
5693
|
"use strict";
|
|
5103
|
-
module.exports = JSON.parse('{"i8":"3.0.0-next.
|
|
5694
|
+
module.exports = JSON.parse('{"i8":"3.0.0-next.40","HO":{"@rspack/core":"^1.6.3","@rspack/dev-server":"^1.1.4","@swc/core":"^1.13.2","@swc/helpers":"^0.5.15","adm-zip":"^0.5.16","browser-extension-manifest-fields":"^2.2.1","case-sensitive-paths-webpack-plugin":"^2.4.0","chokidar":"^4.0.1","chrome-location2":"3.2.1","chromium-location":"1.2.3","content-security-policy-parser":"^0.6.0","cross-spawn":"^7.0.6","dotenv":"^16.4.7","edge-location":"^2.1.1","firefox-location2":"2.1.1","go-git-it":"^5.0.0","ignore":"^6.0.2","loader-utils":"^3.3.1","magic-string":"^0.30.10","package-manager-detector":"^0.2.7","parse5":"^7.2.1","parse5-utilities":"^1.0.0","pintor":"0.3.0","schema-utils":"^4.2.0","tiny-glob":"^0.2.9","unique-names-generator":"^4.7.1","webextension-polyfill":"^0.12.0","webpack-merge":"^6.0.1","webpack-target-webextension":"^2.1.3","ws":"^8.18.0"}}');
|
|
5104
5695
|
}
|
|
5105
5696
|
};
|
|
5106
5697
|
var __webpack_module_cache__ = {};
|
|
@@ -5123,6 +5714,33 @@ __webpack_require__.m = __webpack_modules__;
|
|
|
5123
5714
|
return getter;
|
|
5124
5715
|
};
|
|
5125
5716
|
})();
|
|
5717
|
+
(()=>{
|
|
5718
|
+
var getProto = Object.getPrototypeOf ? (obj)=>Object.getPrototypeOf(obj) : (obj)=>obj.__proto__;
|
|
5719
|
+
var leafPrototypes;
|
|
5720
|
+
__webpack_require__.t = function(value, mode) {
|
|
5721
|
+
if (1 & mode) value = this(value);
|
|
5722
|
+
if (8 & mode) return value;
|
|
5723
|
+
if ('object' == typeof value && value) {
|
|
5724
|
+
if (4 & mode && value.__esModule) return value;
|
|
5725
|
+
if (16 & mode && 'function' == typeof value.then) return value;
|
|
5726
|
+
}
|
|
5727
|
+
var ns = Object.create(null);
|
|
5728
|
+
__webpack_require__.r(ns);
|
|
5729
|
+
var def = {};
|
|
5730
|
+
leafPrototypes = leafPrototypes || [
|
|
5731
|
+
null,
|
|
5732
|
+
getProto({}),
|
|
5733
|
+
getProto([]),
|
|
5734
|
+
getProto(getProto)
|
|
5735
|
+
];
|
|
5736
|
+
for(var current = 2 & mode && value; 'object' == typeof current && !~leafPrototypes.indexOf(current); current = getProto(current))Object.getOwnPropertyNames(current).forEach((key)=>{
|
|
5737
|
+
def[key] = ()=>value[key];
|
|
5738
|
+
});
|
|
5739
|
+
def['default'] = ()=>value;
|
|
5740
|
+
__webpack_require__.d(ns, def);
|
|
5741
|
+
return ns;
|
|
5742
|
+
};
|
|
5743
|
+
})();
|
|
5126
5744
|
(()=>{
|
|
5127
5745
|
__webpack_require__.d = (exports1, definition)=>{
|
|
5128
5746
|
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
@@ -5370,9 +5988,9 @@ var __webpack_exports__ = {};
|
|
|
5370
5988
|
packageJsonPath
|
|
5371
5989
|
};
|
|
5372
5990
|
}
|
|
5373
|
-
|
|
5991
|
+
var external_os_ = __webpack_require__("os");
|
|
5374
5992
|
var external_url_ = __webpack_require__("url");
|
|
5375
|
-
|
|
5993
|
+
var external_module_ = __webpack_require__("module");
|
|
5376
5994
|
const external_dotenv_namespaceObject = require("dotenv");
|
|
5377
5995
|
var external_dotenv_default = /*#__PURE__*/ __webpack_require__.n(external_dotenv_namespaceObject);
|
|
5378
5996
|
function preloadEnvFiles(projectDir) {
|
|
@@ -5403,7 +6021,7 @@ var __webpack_exports__ = {};
|
|
|
5403
6021
|
preloadEnvFiles(projectDir);
|
|
5404
6022
|
try {
|
|
5405
6023
|
if (absolutePath.endsWith('.cjs')) {
|
|
5406
|
-
const requireFn = (0,
|
|
6024
|
+
const requireFn = (0, external_module_.createRequire)(__rslib_import_meta_url__);
|
|
5407
6025
|
const required = requireFn(absolutePath);
|
|
5408
6026
|
return (null == required ? void 0 : required.default) || required;
|
|
5409
6027
|
}
|
|
@@ -5411,7 +6029,7 @@ var __webpack_exports__ = {};
|
|
|
5411
6029
|
try {
|
|
5412
6030
|
const originalContent = external_fs_.readFileSync(absolutePath, 'utf-8');
|
|
5413
6031
|
if (originalContent.includes('import.meta.env')) {
|
|
5414
|
-
const tmpDir = external_fs_.mkdtempSync(external_path_.join(
|
|
6032
|
+
const tmpDir = external_fs_.mkdtempSync(external_path_.join(external_os_.tmpdir(), 'extension-config-esm-'));
|
|
5415
6033
|
const tmpPath = external_path_.join(tmpDir, external_path_.basename(absolutePath));
|
|
5416
6034
|
const envObjectLiteral = JSON.stringify(Object.fromEntries(Object.entries(process.env).map(([k, v])=>[
|
|
5417
6035
|
k,
|
|
@@ -5429,7 +6047,7 @@ var __webpack_exports__ = {};
|
|
|
5429
6047
|
const error = err;
|
|
5430
6048
|
try {
|
|
5431
6049
|
if (!absolutePath.endsWith('.mjs')) {
|
|
5432
|
-
const requireFn = (0,
|
|
6050
|
+
const requireFn = (0, external_module_.createRequire)(__rslib_import_meta_url__);
|
|
5433
6051
|
let required;
|
|
5434
6052
|
try {
|
|
5435
6053
|
required = requireFn(absolutePath);
|
|
@@ -5437,7 +6055,7 @@ var __webpack_exports__ = {};
|
|
|
5437
6055
|
const message = String((null == error ? void 0 : error.message) || '') + ' ' + String((null == requireErr ? void 0 : requireErr.message) || '');
|
|
5438
6056
|
const looksLikeCommonJsInEsm = message.includes('require is not defined in ES module scope') || message.includes('Cannot use import statement outside a module') || message.includes('ERR_REQUIRE_ESM');
|
|
5439
6057
|
if (looksLikeCommonJsInEsm) {
|
|
5440
|
-
const tmpDir = external_fs_.mkdtempSync(external_path_.join(
|
|
6058
|
+
const tmpDir = external_fs_.mkdtempSync(external_path_.join(external_os_.tmpdir(), 'extension-config-'));
|
|
5441
6059
|
const tmpCjsPath = external_path_.join(tmpDir, external_path_.basename(absolutePath, external_path_.extname(absolutePath)) + '.cjs');
|
|
5442
6060
|
external_fs_.copyFileSync(absolutePath, tmpCjsPath);
|
|
5443
6061
|
required = requireFn(tmpCjsPath);
|
|
@@ -6489,7 +7107,7 @@ var __webpack_exports__ = {};
|
|
|
6489
7107
|
const tailwindPresent = tailwind_isUsingTailwind(projectPath);
|
|
6490
7108
|
if (!userPostCssConfig && !pkgHasPostCss && !tailwindPresent) return {};
|
|
6491
7109
|
if (tailwindPresent) try {
|
|
6492
|
-
const req = (0,
|
|
7110
|
+
const req = (0, external_module_.createRequire)(external_path_.join(projectPath, 'package.json'));
|
|
6493
7111
|
req.resolve('@tailwindcss/postcss');
|
|
6494
7112
|
} catch {
|
|
6495
7113
|
console.error(`PostCSS plugin "@tailwindcss/postcss" not found in ${projectPath}.\nInstall it in that package (e.g. "pnpm add -D @tailwindcss/postcss") and retry.`);
|
|
@@ -6510,7 +7128,7 @@ var __webpack_exports__ = {};
|
|
|
6510
7128
|
}
|
|
6511
7129
|
function getProjectPostcssImpl() {
|
|
6512
7130
|
try {
|
|
6513
|
-
const req = (0,
|
|
7131
|
+
const req = (0, external_module_.createRequire)(external_path_.join(projectPath, 'package.json'));
|
|
6514
7132
|
return req('postcss');
|
|
6515
7133
|
} catch {
|
|
6516
7134
|
try {
|
|
@@ -6520,7 +7138,47 @@ var __webpack_exports__ = {};
|
|
|
6520
7138
|
}
|
|
6521
7139
|
}
|
|
6522
7140
|
}
|
|
6523
|
-
const reqFromProject = (0,
|
|
7141
|
+
const reqFromProject = (0, external_module_.createRequire)(external_path_.join(projectPath, 'package.json'));
|
|
7142
|
+
async function loadUserPostcssPlugins() {
|
|
7143
|
+
try {
|
|
7144
|
+
let plc;
|
|
7145
|
+
try {
|
|
7146
|
+
plc = reqFromProject('postcss-load-config');
|
|
7147
|
+
} catch {
|
|
7148
|
+
try {
|
|
7149
|
+
plc = __webpack_require__("../../node_modules/.pnpm/postcss-load-config@6.0.1_jiti@2.6.1_postcss@8.5.6_tsx@4.21.0_yaml@2.8.1/node_modules/postcss-load-config/src/index.js");
|
|
7150
|
+
} catch {
|
|
7151
|
+
return {
|
|
7152
|
+
plugins: void 0,
|
|
7153
|
+
loaded: false
|
|
7154
|
+
};
|
|
7155
|
+
}
|
|
7156
|
+
}
|
|
7157
|
+
const loadConfig = 'function' == typeof plc ? plc : (null == plc ? void 0 : plc.default) ? plc.default : plc;
|
|
7158
|
+
if ('function' != typeof loadConfig) return {
|
|
7159
|
+
plugins: void 0,
|
|
7160
|
+
loaded: false
|
|
7161
|
+
};
|
|
7162
|
+
const result = await loadConfig({}, projectPath);
|
|
7163
|
+
const plugins = Array.isArray(null == result ? void 0 : result.plugins) ? result.plugins : Object.entries((null == result ? void 0 : result.plugins) || {}).map(([plugin, options])=>{
|
|
7164
|
+
try {
|
|
7165
|
+
const mod = 'string' == typeof plugin ? reqFromProject(plugin) : plugin;
|
|
7166
|
+
return 'function' == typeof mod ? mod(options) : mod;
|
|
7167
|
+
} catch {
|
|
7168
|
+
return;
|
|
7169
|
+
}
|
|
7170
|
+
}).filter(Boolean);
|
|
7171
|
+
return {
|
|
7172
|
+
plugins,
|
|
7173
|
+
loaded: true
|
|
7174
|
+
};
|
|
7175
|
+
} catch {
|
|
7176
|
+
return {
|
|
7177
|
+
plugins: void 0,
|
|
7178
|
+
loaded: false
|
|
7179
|
+
};
|
|
7180
|
+
}
|
|
7181
|
+
}
|
|
6524
7182
|
let inlinePlugins;
|
|
6525
7183
|
if (!userPostCssConfig && !pkgHasPostCss && tailwindPresent) try {
|
|
6526
7184
|
inlinePlugins = [
|
|
@@ -6530,6 +7188,11 @@ var __webpack_exports__ = {};
|
|
|
6530
7188
|
console.error(`PostCSS plugin "@tailwindcss/postcss" not found in ${projectPath}.\nInstall it in that package (e.g. "pnpm add -D @tailwindcss/postcss") and retry.`);
|
|
6531
7189
|
process.exit(1);
|
|
6532
7190
|
}
|
|
7191
|
+
let resolvedPlugins = inlinePlugins;
|
|
7192
|
+
if ((userPostCssConfig || pkgHasPostCss) && !inlinePlugins) {
|
|
7193
|
+
const loaded = await loadUserPostcssPlugins();
|
|
7194
|
+
if (loaded.loaded && Array.isArray(loaded.plugins) && loaded.plugins.length) resolvedPlugins = loaded.plugins;
|
|
7195
|
+
}
|
|
6533
7196
|
return {
|
|
6534
7197
|
test: /\.css$/,
|
|
6535
7198
|
type: 'css',
|
|
@@ -6539,8 +7202,8 @@ var __webpack_exports__ = {};
|
|
|
6539
7202
|
postcssOptions: {
|
|
6540
7203
|
ident: 'postcss',
|
|
6541
7204
|
cwd: projectPath,
|
|
6542
|
-
config: userPostCssConfig || pkgHasPostCss ? projectPath : false,
|
|
6543
|
-
plugins:
|
|
7205
|
+
config: resolvedPlugins && resolvedPlugins.length ? false : userPostCssConfig || pkgHasPostCss ? projectPath : false,
|
|
7206
|
+
plugins: resolvedPlugins
|
|
6544
7207
|
},
|
|
6545
7208
|
sourceMap: 'development' === opts.mode
|
|
6546
7209
|
}
|
|
@@ -7029,7 +7692,7 @@ var __webpack_exports__ = {};
|
|
|
7029
7692
|
overlay: false
|
|
7030
7693
|
})
|
|
7031
7694
|
];
|
|
7032
|
-
const requireFromProject = (0,
|
|
7695
|
+
const requireFromProject = (0, external_module_.createRequire)(external_path_.join(projectPath, 'package.json'));
|
|
7033
7696
|
let reactPath;
|
|
7034
7697
|
let reactDomPath;
|
|
7035
7698
|
let reactDomClientPath;
|
|
@@ -9901,7 +10564,7 @@ var __webpack_exports__ = {};
|
|
|
9901
10564
|
}
|
|
9902
10565
|
const external_webpack_target_webextension_namespaceObject = require("webpack-target-webextension");
|
|
9903
10566
|
var external_webpack_target_webextension_default = /*#__PURE__*/ __webpack_require__.n(external_webpack_target_webextension_namespaceObject);
|
|
9904
|
-
|
|
10567
|
+
var external_node_module_ = __webpack_require__("node:module");
|
|
9905
10568
|
function manifest_getManifestContent(compilation, manifestPath) {
|
|
9906
10569
|
var _compilation_getAsset, _compilation_assets;
|
|
9907
10570
|
if ((null == (_compilation_getAsset = compilation.getAsset) ? void 0 : _compilation_getAsset.call(compilation, 'manifest.json')) || (null == (_compilation_assets = compilation.assets) ? void 0 : _compilation_assets['manifest.json'])) {
|
|
@@ -10262,7 +10925,7 @@ var __webpack_exports__ = {};
|
|
|
10262
10925
|
else obj[key] = value;
|
|
10263
10926
|
return obj;
|
|
10264
10927
|
}
|
|
10265
|
-
const requireForEsm = (0,
|
|
10928
|
+
const requireForEsm = (0, external_node_module_.createRequire)(__rslib_import_meta_url__);
|
|
10266
10929
|
function tryLoadWebExtensionFork() {
|
|
10267
10930
|
try {
|
|
10268
10931
|
const mod = requireForEsm('./webpack-target-webextension-fork');
|
|
@@ -10871,7 +11534,7 @@ var __webpack_exports__ = {};
|
|
|
10871
11534
|
}
|
|
10872
11535
|
class ThrowIfManifestJsonChange {
|
|
10873
11536
|
readCriticalJsonList() {
|
|
10874
|
-
const requireFn = (0,
|
|
11537
|
+
const requireFn = (0, external_node_module_.createRequire)(__rslib_import_meta_url__);
|
|
10875
11538
|
const { getManifestFieldsData } = requireFn('browser-extension-manifest-fields');
|
|
10876
11539
|
const fields = getManifestFieldsData({
|
|
10877
11540
|
manifestPath: this.manifestPath,
|
|
@@ -11362,7 +12025,7 @@ var __webpack_exports__ = {};
|
|
|
11362
12025
|
}
|
|
11363
12026
|
class ThrowIfManifestIconsChange {
|
|
11364
12027
|
readIconsList() {
|
|
11365
|
-
const requireFn = (0,
|
|
12028
|
+
const requireFn = (0, external_node_module_.createRequire)(__rslib_import_meta_url__);
|
|
11366
12029
|
const { getManifestFieldsData } = requireFn('browser-extension-manifest-fields');
|
|
11367
12030
|
const fields = getManifestFieldsData({
|
|
11368
12031
|
manifestPath: this.manifestPath,
|
|
@@ -12534,7 +13197,7 @@ var __webpack_exports__ = {};
|
|
|
12534
13197
|
if (!filePath) return filePath;
|
|
12535
13198
|
let normalizedPath = String(filePath).trim();
|
|
12536
13199
|
if (filePath.startsWith('"') && filePath.endsWith('"') || filePath.startsWith("'") && filePath.endsWith("'")) filePath = filePath.slice(1, -1);
|
|
12537
|
-
if (normalizedPath.startsWith('~')) normalizedPath = external_path_.join(
|
|
13200
|
+
if (normalizedPath.startsWith('~')) normalizedPath = external_path_.join(external_os_.homedir(), normalizedPath.slice(1));
|
|
12538
13201
|
return normalizedPath;
|
|
12539
13202
|
};
|
|
12540
13203
|
const chromiumBinary = normalizePath(options.chromiumBinary);
|