@plaudit/webpack-extensions 2.89.2 → 3.0.0-rc.2

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 (55) hide show
  1. package/CHANGELOG.md +0 -106
  2. package/USER-GUIDE.md +81 -117
  3. package/{dist → build}/plugins/EnhancedBlockJSONPlugin.d.ts +4 -7
  4. package/{dist → build}/plugins/EnhancedBlockJSONPlugin.js +53 -116
  5. package/{dist → build}/plugins/ExtensionsConfigFileGeneratorPlugin.d.ts +3 -7
  6. package/{dist → build}/plugins/ExtensionsConfigFileGeneratorPlugin.js +10 -74
  7. package/{dist → build}/plugins/ExtensionsConfigFileGeneratorPluginV1.d.ts +1 -1
  8. package/{dist → build}/plugins/ExtensionsConfigFileGeneratorPluginV1.js +0 -4
  9. package/{dist → build}/plugins/PlainEntrypointsConfigFileGeneratorPlugin.js +20 -46
  10. package/{dist → build}/plugins/UnifiedLoaderGenerator.d.ts +2 -1
  11. package/build/plugins/static-configs.d.ts +3 -0
  12. package/build/plugins/static-configs.js +33 -0
  13. package/{dist → build}/shared.d.ts +18 -86
  14. package/{dist → build}/shared.js +11 -124
  15. package/{dist → build}/utils/common-config-helpers.d.ts +1 -1
  16. package/{dist → build}/utils/common-config-helpers.js +49 -126
  17. package/{dist → build}/wordpress-scripts-wrapper.js +36 -70
  18. package/package.json +26 -35
  19. package/dist/plugins/static-configs.d.ts +0 -3
  20. package/dist/plugins/static-configs.js +0 -91
  21. package/dist/utils/entrypoint-resolution-logic.d.ts +0 -10
  22. package/dist/utils/entrypoint-resolution-logic.js +0 -82
  23. package/dist/utils/location-encoding-filename-parser.d.ts +0 -26
  24. package/dist/utils/location-encoding-filename-parser.js +0 -118
  25. package/dist/utils/path-query-and-related-helpers.d.ts +0 -58
  26. package/dist/utils/path-query-and-related-helpers.js +0 -263
  27. /package/{dist → build}/plugins/AbstractBiPhasicGroupAndEntryPlugin.d.ts +0 -0
  28. /package/{dist → build}/plugins/AbstractBiPhasicGroupAndEntryPlugin.js +0 -0
  29. /package/{dist → build}/plugins/AbstractBiPhasicGroupPlugin.d.ts +0 -0
  30. /package/{dist → build}/plugins/AbstractBiPhasicGroupPlugin.js +0 -0
  31. /package/{dist → build}/plugins/AdditionalDependencyInjectorPlugin.d.ts +0 -0
  32. /package/{dist → build}/plugins/AdditionalDependencyInjectorPlugin.js +0 -0
  33. /package/{dist → build}/plugins/BrowserSyncPlugin.d.ts +0 -0
  34. /package/{dist → build}/plugins/BrowserSyncPlugin.js +0 -0
  35. /package/{dist → build}/plugins/EnhancedDynamicEntryPlugin.d.ts +0 -0
  36. /package/{dist → build}/plugins/EnhancedDynamicEntryPlugin.js +0 -0
  37. /package/{dist → build}/plugins/MiniCSSExtractPluginErrorCleaner.d.ts +0 -0
  38. /package/{dist → build}/plugins/MiniCSSExtractPluginErrorCleaner.js +0 -0
  39. /package/{dist → build}/plugins/PackageConfigSanityChecker.d.ts +0 -0
  40. /package/{dist → build}/plugins/PackageConfigSanityChecker.js +0 -0
  41. /package/{dist → build}/plugins/PlainEntrypointsConfigFileGeneratorPlugin.d.ts +0 -0
  42. /package/{dist → build}/plugins/SpecialAssetHandlingPlugin.d.ts +0 -0
  43. /package/{dist → build}/plugins/SpecialAssetHandlingPlugin.js +0 -0
  44. /package/{dist → build}/plugins/UnifiedLoaderGenerator.js +0 -0
  45. /package/{dist → build}/plugins/VariablesJSMonitorPlugin.d.ts +0 -0
  46. /package/{dist → build}/plugins/VariablesJSMonitorPlugin.js +0 -0
  47. /package/{dist → build}/plugins/WPMLConfigBuilder.d.ts +0 -0
  48. /package/{dist → build}/plugins/WPMLConfigBuilder.js +0 -0
  49. /package/{dist → build}/plugins/dependency-extraction-webpack-plugin-config-builder.d.ts +0 -0
  50. /package/{dist → build}/plugins/dependency-extraction-webpack-plugin-config-builder.js +0 -0
  51. /package/{dist → build}/utils/css-writer.d.ts +0 -0
  52. /package/{dist → build}/utils/css-writer.js +0 -0
  53. /package/{dist → build}/utils/pseduo-semaphore.d.ts +0 -0
  54. /package/{dist → build}/utils/pseduo-semaphore.js +0 -0
  55. /package/{dist → build}/wordpress-scripts-wrapper.d.ts +0 -0
@@ -8,21 +8,19 @@ exports.groupEntrypointsByAssetFile = groupEntrypointsByAssetFile;
8
8
  exports.resolveEntryFromDirectory = resolveEntryFromDirectory;
9
9
  exports.commonMakeWebpackConfig = commonMakeWebpackConfig;
10
10
  const node_fs_1 = __importDefault(require("node:fs"));
11
- const promises_1 = require("node:fs/promises");
12
- const node_path_1 = require("node:path");
13
- const location_encoding_filename_parser_1 = require("./location-encoding-filename-parser");
14
- const path_query_and_related_helpers_1 = require("./path-query-and-related-helpers");
11
+ const promises_1 = __importDefault(require("node:fs/promises"));
12
+ const node_path_1 = __importDefault(require("node:path"));
15
13
  const shared_1 = require("../shared");
16
14
  const css_minimizer_webpack_plugin_1 = __importDefault(require("css-minimizer-webpack-plugin"));
17
15
  function joinPossiblyAbsolutePaths(...paths) {
18
16
  return paths.filter((p) => !!p)
19
- .reduce((res, p) => !res || (0, node_path_1.isAbsolute)(p) ? p : (0, node_path_1.join)(res, p), '') || '.';
17
+ .reduce((res, p) => !res || node_path_1.default.isAbsolute(p) ? p : node_path_1.default.join(res, p), '') || '.';
20
18
  }
21
19
  function groupEntrypointsByAssetFile(entrypoints, entrypointNameExtractor) {
22
20
  const seenPaths = new Map();
23
21
  for (const entrypoint of entrypoints) {
24
22
  const entrypointName = entrypointNameExtractor(entrypoint);
25
- const key = entrypointName.substring(0, entrypointName.length - (0, node_path_1.extname)(entrypointName).length);
23
+ const key = entrypointName.substring(0, entrypointName.length - node_path_1.default.extname(entrypointName).length);
26
24
  let seen = seenPaths.get(key);
27
25
  if (seen === undefined) {
28
26
  seenPaths.set(key, seen = []);
@@ -36,11 +34,9 @@ function mapToRealEntrypoints(entrypoint, dir, supportedExtensions, args) {
36
34
  return (Array.isArray(entrypoint) ? entrypoint : [entrypoint])
37
35
  .map(ep => joinPossiblyAbsolutePaths(dir, mapper(ep)))
38
36
  .filter(ep => supportedExtensions(ep) && node_fs_1.default.statSync(ep, { throwIfNoEntry: false })?.isFile())
39
- .map(path_query_and_related_helpers_1.unpackPotentiallyPrefixedFilePath)
40
- .map(([ep, rawPathQueryParameters]) => {
41
- const parsedEntrypoint = (0, node_path_1.parse)(ep);
37
+ .map(ep => {
38
+ const parsedEntrypoint = node_path_1.default.parse(ep);
42
39
  const entrypointField = shared_1.styleExtension.test(ep) ? 'style' : shared_1.scriptWithModuleExtension.test(ep) ? 'viewScriptModule' : 'script';
43
- const { flags: enqueuingFlags, remainder: pathQueryParameters } = (0, path_query_and_related_helpers_1.unpackEnqueuingControlFlagsFromPathQueryParameters)(rawPathQueryParameters, ep, 'path query parameters');
44
40
  const fakeEntrypointInfo = {
45
41
  blockJsonOrigin: args.entrypointJsonOrigin,
46
42
  entrypointField,
@@ -49,16 +45,14 @@ function mapToRealEntrypoints(entrypoint, dir, supportedExtensions, args) {
49
45
  handle: (0, shared_1.convertUsageLocationsHandleToEmittableHandle)(dest.locations.handle, parsedEntrypoint.name),
50
46
  handleGroup: (0, shared_1.getHandleGroup)(entrypointField),
51
47
  dest,
52
- absoluteSrc: ep,
53
- pathQueryParameters,
54
- enqueuingFlags,
48
+ absoluteSrc: ep
55
49
  };
56
- return [joinPossiblyAbsolutePaths(dest.destination, (0, node_path_1.basename)(parsedEntrypoint.dir), parsedEntrypoint.name),
50
+ return [joinPossiblyAbsolutePaths(dest.destination, node_path_1.default.basename(parsedEntrypoint.dir), parsedEntrypoint.name),
57
51
  { import: [ep], plauditMetadata: fakeEntrypointInfo }];
58
52
  });
59
53
  }
60
54
  function parseEntrypointsJSON(dir, dest, supportedExtensions) {
61
- const entrypointJsonOrigin = (0, node_path_1.join)(dir, 'entrypoints.json');
55
+ const entrypointJsonOrigin = node_path_1.default.join(dir, 'entrypoints.json');
62
56
  const entrypointsJSON = JSON.parse(node_fs_1.default.readFileSync(entrypointJsonOrigin, 'utf8'));
63
57
  if (Array.isArray(entrypointsJSON)) {
64
58
  return mapToRealEntrypoints(entrypointsJSON, dir, supportedExtensions, { dest, entrypointJsonOrigin });
@@ -101,7 +95,7 @@ function determineEntrypointType(entrypoint, scriptExtension) {
101
95
  }
102
96
  }
103
97
  function injectTypeAndCountToEntrypointName(entrypointName, type, typeCounts) {
104
- const entrypointBasename = entrypointName.substring(0, entrypointName.length - (0, node_path_1.extname)(entrypointName).length);
98
+ const entrypointBasename = entrypointName.substring(0, entrypointName.length - node_path_1.default.extname(entrypointName).length);
105
99
  const parts = [];
106
100
  if (type) {
107
101
  parts.push(type);
@@ -110,7 +104,7 @@ function injectTypeAndCountToEntrypointName(entrypointName, type, typeCounts) {
110
104
  parts.push(typeCounts[type].toString());
111
105
  }
112
106
  typeCounts[type] += 1;
113
- return `${entrypointBasename}_${parts.join('-')}${(0, node_path_1.extname)(entrypointName)}`;
107
+ return `${entrypointBasename}_${parts.join('-')}${node_path_1.default.extname(entrypointName)}`;
114
108
  }
115
109
  function addPotentiallyDuplicatedEntrypointName(entry, entrypoint, typeCounts, scriptExtension) {
116
110
  const type = determineEntrypointType(entrypoint, scriptExtension);
@@ -123,9 +117,8 @@ function addPotentiallyDuplicatedEntrypointName(entry, entrypoint, typeCounts, s
123
117
  function resolveEntryFromDirectory(commonConfig, srcRoot, dest) {
124
118
  const { entrypointFields, processingModules, scriptExtension } = commonConfig;
125
119
  return async () => {
126
- const seenExplicitHandles = { scriptHandles: {}, styleHandles: {}, scriptModuleHandles: {} };
127
120
  const loadingEntrypoints = [];
128
- for await (const dirent of await (0, promises_1.opendir)(srcRoot)) {
121
+ for await (const dirent of await promises_1.default.opendir(srcRoot)) {
129
122
  if (!dirent.isDirectory() || dirent.name.startsWith("~")) {
130
123
  continue;
131
124
  }
@@ -134,91 +127,31 @@ function resolveEntryFromDirectory(commonConfig, srcRoot, dest) {
134
127
  const rawEntrypoints = [];
135
128
  const wpmlFiles = [];
136
129
  try {
137
- const blockJsonOrigin = (0, node_path_1.join)(dir, 'block.json');
138
- const blockJson = JSON.parse(await (0, promises_1.readFile)(blockJsonOrigin, 'utf8'));
139
- const blockJsonChunkName = (0, node_path_1.join)(dest.destination, (0, node_path_1.relative)(srcRoot, dir), "block");
140
- const filesRegisteredByJson = [];
130
+ const blockJsonOrigin = node_path_1.default.join(dir, 'block.json');
131
+ const blockJson = JSON.parse(await promises_1.default.readFile(blockJsonOrigin, 'utf8'));
132
+ const blockJsonChunkName = node_path_1.default.join(dest.destination, node_path_1.default.relative(srcRoot, dir), "block");
141
133
  const presentEntrypoints = (await Promise.all(entrypointFields
142
134
  .filter(entrypointField => entrypointField in blockJson)
143
135
  .flatMap(entrypointField => {
144
136
  return (Array.isArray(blockJson[entrypointField]) ? blockJson[entrypointField] : [blockJson[entrypointField]])
145
- .filter(originalValue => typeof originalValue === 'string')
146
- .filter(originalValue => originalValue?.startsWith("file:"))
147
- .map(async (originalValue) => {
148
- const [entrypointPath, rawLocalPathQueryParameters] = (0, path_query_and_related_helpers_1.unpackPotentiallyPrefixedFilePath)(originalValue);
149
- const absoluteSrc = (0, node_path_1.normalize)((0, node_path_1.join)(dir, entrypointPath));
150
- filesRegisteredByJson.push(absoluteSrc);
151
- const parsedFilename = (0, location_encoding_filename_parser_1.parseLocationEncodingFilenameForBlock)(absoluteSrc);
152
- const { flags: localEnqueuingFlags, handle, remainder: localPathQueryParameters } = (0, path_query_and_related_helpers_1.unpackEnqueuingControlFlagsFromPathQueryParameters)(rawLocalPathQueryParameters, absoluteSrc, "path query parameters");
153
- const enqueuingFlags = (0, path_query_and_related_helpers_1.mergeTwoEnqueuingControlFlagSets)(absoluteSrc, localEnqueuingFlags, parsedFilename?.flags, dest.enqueuingFlags);
154
- const pathQueryParameters = { ...dest.pathQueryParameters, ...localPathQueryParameters };
155
- try {
156
- const stats = await (0, promises_1.stat)(absoluteSrc);
157
- if (!stats.isFile()) {
158
- return undefined;
137
+ .filter(originalValue => originalValue.startsWith("file:"))
138
+ .map(originalValue => {
139
+ const entrypointPath = originalValue.substring(5);
140
+ const absoluteSrc = node_path_1.default.normalize(node_path_1.default.join(dir, entrypointPath));
141
+ return promises_1.default.stat(absoluteSrc)
142
+ .then(stats => {
143
+ if (stats.isFile()) {
144
+ const parsedEntrypoint = node_path_1.default.parse(node_path_1.default.normalize(node_path_1.default.join(dest.destination, node_path_1.default.relative(srcRoot, dir), entrypointPath)));
145
+ const extensionlessExpectedSrc = node_path_1.default.normalize(node_path_1.default.join(parsedEntrypoint.dir, parsedEntrypoint.name));
146
+ const entrypointName = node_path_1.default.normalize(joinPossiblyAbsolutePaths(parsedEntrypoint.dir, parsedEntrypoint.name));
147
+ return { entrypointField, originalValue, entrypointName, extensionlessExpectedSrc, absoluteSrc };
159
148
  }
160
- const parsedEntrypoint = (0, node_path_1.parse)((0, node_path_1.normalize)((0, node_path_1.join)(dest.destination, (0, node_path_1.relative)(srcRoot, dir), entrypointPath)));
161
- const extensionlessExpectedSrc = (0, node_path_1.normalize)((0, node_path_1.join)(parsedEntrypoint.dir, parsedEntrypoint.name));
162
- const entrypointName = (0, node_path_1.normalize)(joinPossiblyAbsolutePaths(parsedEntrypoint.dir, parsedEntrypoint.name));
163
- return { entrypointField, originalValue, entrypointName, extensionlessExpectedSrc, absoluteSrc, pathQueryParameters, enqueuingFlags, handle };
164
- }
165
- catch {
166
- return undefined;
167
- }
168
- });
169
- })))
170
- .filter(pe => pe !== undefined);
171
- for await (const dirent of await (0, promises_1.opendir)(dir)) {
172
- if (!dirent.isFile()) {
173
- continue;
174
- }
175
- const absoluteSrc = (0, node_path_1.normalize)((0, node_path_1.join)(dir, dirent.name));
176
- if (filesRegisteredByJson.includes(absoluteSrc)) {
177
- continue;
178
- }
179
- const parsedFilename = (0, location_encoding_filename_parser_1.parseLocationEncodingFilenameForBlock)(absoluteSrc);
180
- if (!parsedFilename) {
181
- continue;
182
- }
183
- const { type, locations, flags } = parsedFilename;
184
- let entrypointField;
185
- if (Object.keys(locations).length === 2) {
186
- if (type === 'script-module') {
187
- console.error(`Blocks cannot have script modules enqueued in editor mode. Found one enqueued in both editor and view in ${dirent.parentPath}. It will be enqueued in view alone.`);
188
- entrypointField = 'viewScriptModule';
189
- }
190
- else {
191
- entrypointField = type;
192
- }
193
- }
194
- else {
195
- const location = (0, shared_1.constantKeys)(locations)[0];
196
- if (type === 'script-module') {
197
- if (location !== 'clientView') {
198
- console.error(`Blocks cannot have script modules enqueued in editor mode. Found one in ${dirent.parentPath}. It will be ignored`);
199
- continue;
149
+ else {
150
+ return undefined;
200
151
  }
201
- entrypointField = 'viewScriptModule';
202
- }
203
- else {
204
- entrypointField = (location.substring(6).toLowerCase() + type.substring(0, 1).toUpperCase() + type.substring(1));
205
- }
206
- }
207
- const parsedEntrypoint = (0, node_path_1.parse)((0, node_path_1.normalize)((0, node_path_1.join)(dest.destination, (0, node_path_1.relative)(srcRoot, dir), `./${dirent.name}`)));
208
- const extensionlessExpectedSrc = (0, node_path_1.normalize)((0, node_path_1.join)(parsedEntrypoint.dir, parsedEntrypoint.name));
209
- const entrypointName = (0, node_path_1.normalize)(joinPossiblyAbsolutePaths(parsedEntrypoint.dir, parsedEntrypoint.name));
210
- const enqueuingFlags = (0, path_query_and_related_helpers_1.mergeTwoEnqueuingControlFlagSets)(absoluteSrc, flags, dest.enqueuingFlags);
211
- presentEntrypoints.push({
212
- entrypointField,
213
- originalValue: dirent.name,
214
- entrypointName,
215
- extensionlessExpectedSrc,
216
- absoluteSrc,
217
- pathQueryParameters: dest.pathQueryParameters,
218
- enqueuingFlags,
219
- handle: undefined
152
+ }, () => undefined);
220
153
  });
221
- }
154
+ }))).filter(pe => pe !== undefined);
222
155
  const entrypointNamesWithEffectiveDuplicates = presentEntrypoints
223
156
  .reduce((a, entry) => {
224
157
  // If it's undefined, then this is the first instance, otherwise, it's not the first instance and, therefore, is expected to be a duplicate
@@ -229,15 +162,12 @@ function resolveEntryFromDirectory(commonConfig, srcRoot, dest) {
229
162
  const allocatedDestinations = {};
230
163
  const resolvedBlockEntrypoints = presentEntrypoints
231
164
  .map(presentEntrypoint => {
232
- const overallSource = (0, node_path_1.dirname)(blockJsonOrigin);
233
- const overallSourceRelativeName = (0, node_path_1.relative)(overallSource, (0, node_path_1.normalize)((0, node_path_1.join)(blockJsonOrigin, (0, node_path_1.relative)(overallSource, presentEntrypoint.extensionlessExpectedSrc))));
165
+ const overallSource = node_path_1.default.dirname(blockJsonOrigin);
166
+ const overallSourceRelativeName = node_path_1.default.relative(overallSource, node_path_1.default.normalize(node_path_1.default.join(blockJsonOrigin, node_path_1.default.relative(overallSource, presentEntrypoint.extensionlessExpectedSrc))));
234
167
  const handleSuffix = (0, shared_1.convertUsageLocationsHandleToEmittableHandle)(dest.locations.handle, overallSourceRelativeName);
235
168
  const handleGroup = (0, shared_1.getHandleGroup)(presentEntrypoint.entrypointField);
236
- if (presentEntrypoint.handle) {
237
- (seenExplicitHandles[handleGroup][presentEntrypoint.handle] ??= []).push(overallSource);
238
- }
239
169
  if (!entrypointNamesWithEffectiveDuplicates[presentEntrypoint.entrypointName]) {
240
- return { blockJsonOrigin, ...presentEntrypoint, handle: presentEntrypoint.handle ?? `${handlePrefix}/${handleSuffix}`, dest, handleGroup };
170
+ return { blockJsonOrigin, ...presentEntrypoint, handle: `${handlePrefix}/${handleSuffix}`, dest, handleGroup };
241
171
  }
242
172
  const baseSuffix = `_${(0, shared_1.isStyleField)(presentEntrypoint.entrypointField) ? "style" : "script"}`;
243
173
  let count = 0, suffix = baseSuffix, deduplicatedEntrypointName;
@@ -252,7 +182,7 @@ function resolveEntryFromDirectory(commonConfig, srcRoot, dest) {
252
182
  ...presentEntrypoint,
253
183
  entrypointName: deduplicatedEntrypointName,
254
184
  extensionlessExpectedSrc: deduplicatedExtensionlessExpectedSrc,
255
- handle: presentEntrypoint.handle ?? `${handlePrefix}/${count ? handleSuffix + "_" + count : handleSuffix}`, handleGroup,
185
+ handle: `${handlePrefix}/${count ? handleSuffix + "_" + count : handleSuffix}`, handleGroup,
256
186
  dest
257
187
  };
258
188
  });
@@ -267,12 +197,12 @@ function resolveEntryFromDirectory(commonConfig, srcRoot, dest) {
267
197
  ];
268
198
  }));
269
199
  rawEntrypoints.push([blockJsonChunkName, { import: [blockJsonOrigin], plauditMetadata: { purpose: "block-json-inclusion-assurance", dest, absoluteSrc: blockJsonOrigin } }]);
270
- wpmlFiles.push((0, node_path_1.join)(dir, 'block.json'));
200
+ wpmlFiles.push(node_path_1.default.join(dir, 'block.json'));
271
201
  }
272
202
  catch (e) {
273
203
  try {
274
- const packageJsonOrigin = (0, node_path_1.join)(dir, 'package.json');
275
- const packageJson = JSON.parse(await (0, promises_1.readFile)(packageJsonOrigin, 'utf8'));
204
+ const packageJsonOrigin = node_path_1.default.join(dir, 'package.json');
205
+ const packageJson = JSON.parse(await promises_1.default.readFile(packageJsonOrigin, 'utf8'));
276
206
  if (packageJson['main']) {
277
207
  rawEntrypoints.push(...mapToRealEntrypoints(packageJson['main'], dir, commonConfig.scriptExtension.test, { dest, entrypointJsonOrigin: packageJsonOrigin }));
278
208
  }
@@ -291,8 +221,8 @@ function resolveEntryFromDirectory(commonConfig, srcRoot, dest) {
291
221
  }
292
222
  if (!processingModules) {
293
223
  try {
294
- const wpmlFilePath = (0, node_path_1.join)(dir, "wpml-config.xml");
295
- await (0, promises_1.access)(wpmlFilePath);
224
+ const wpmlFilePath = node_path_1.default.join(dir, "wpml-config.xml");
225
+ await promises_1.default.access(wpmlFilePath);
296
226
  wpmlFiles.push(wpmlFilePath);
297
227
  }
298
228
  catch (e) {
@@ -304,13 +234,6 @@ function resolveEntryFromDirectory(commonConfig, srcRoot, dest) {
304
234
  }
305
235
  const allEntrypoints = await Promise.all(loadingEntrypoints);
306
236
  const perAssetPathGroupedEntrypoints = groupEntrypointsByAssetFile(allEntrypoints.flatMap(e => e[0]), e => e[0]);
307
- const conflictingHandles = Object.values(seenExplicitHandles)
308
- .flatMap(handles => Object.entries(handles))
309
- .filter(([, sources]) => sources.length > 1)
310
- .map(([handle, sources]) => `${handle}: ${sources.join(", ")}`);
311
- if (conflictingHandles.length > 0) {
312
- throw (0, shared_1.newCleanWebpackError)("Encountered conflicting explicitly-set handles:\n" + conflictingHandles.join("\n"));
313
- }
314
237
  const currentEntry = {};
315
238
  for (const groupedEntrypoints of perAssetPathGroupedEntrypoints.values()) {
316
239
  if (groupedEntrypoints.length === 1 && groupedEntrypoints[0] !== undefined) {
@@ -325,10 +248,10 @@ function resolveEntryFromDirectory(commonConfig, srcRoot, dest) {
325
248
  }
326
249
  if (!processingModules) {
327
250
  const wpmlEntrypointFiles = allEntrypoints.flatMap(e => e[1]);
328
- const absoluteSrc = (0, node_path_1.join)(srcRoot, "wpml-config.xml");
251
+ const absoluteSrc = node_path_1.default.join(srcRoot, "wpml-config.xml");
329
252
  try {
330
- await (0, promises_1.access)(absoluteSrc);
331
- currentEntry["wpml-config.xml"] = { import: [(0, node_path_1.join)(srcRoot, "wpml-config.xml"), ...wpmlEntrypointFiles], plauditMetadata: { purpose: "wpml-config-xml", dest, absoluteSrc } };
253
+ await promises_1.default.access(absoluteSrc);
254
+ currentEntry["wpml-config.xml"] = { import: [node_path_1.default.join(srcRoot, "wpml-config.xml"), ...wpmlEntrypointFiles], plauditMetadata: { purpose: "wpml-config-xml", dest, absoluteSrc } };
332
255
  }
333
256
  catch (e) {
334
257
  // If the wpml-config.xml file does not exist, just "import" the other files that will be used to build the emitted version
@@ -348,14 +271,14 @@ function commonMakeWebpackConfig(config, commonConfig, webpackConfig, externaliz
348
271
  let viableRoots = [...(Array.isArray(webpackConfig.context) ? webpackConfig.context : [webpackConfig.context ?? process.cwd()])];
349
272
  let wpContentHolderDirectory = process.cwd();
350
273
  while (wpContentHolderDirectory.length > 5) {
351
- if ((0, node_path_1.basename)(wpContentHolderDirectory) === 'wp-content') {
352
- wpContentHolderDirectory = (0, node_path_1.dirname)(wpContentHolderDirectory);
274
+ if (node_path_1.default.basename(wpContentHolderDirectory) === 'wp-content') {
275
+ wpContentHolderDirectory = node_path_1.default.dirname(wpContentHolderDirectory);
353
276
  if (wpContentHolderDirectory.length > 5) {
354
277
  viableRoots.push(wpContentHolderDirectory);
355
278
  }
356
279
  break;
357
280
  }
358
- wpContentHolderDirectory = (0, node_path_1.dirname)(wpContentHolderDirectory);
281
+ wpContentHolderDirectory = node_path_1.default.dirname(wpContentHolderDirectory);
359
282
  }
360
283
  const distinctViableRoots = new Set();
361
284
  viableRoots = viableRoots.filter(value => distinctViableRoots.has(value) ? false : distinctViableRoots.add(value) && true);
@@ -402,16 +325,16 @@ function commonMakeWebpackConfig(config, commonConfig, webpackConfig, externaliz
402
325
  ...(webpackConfig.optimization?.splitChunks || {}),
403
326
  cacheGroups: {
404
327
  style: {
405
- // This is a flagrant abuse of cache groups, but it fixes a persistent problem wherein the dependencies and versions of scripts and styles were bleeding into each other
328
+ // This is a flagrant abuse of cache groups, but it fixes a persistent problem wherein the dependencies and versions of scripts and styles were bleeding into each-other
406
329
  type: 'css/mini-extract',
407
330
  chunks: 'all',
408
331
  enforce: true,
409
332
  name(_, chunks, cacheGroupKey) {
410
333
  const chunkName = chunks.find(chunk => chunk.name)?.name;
411
334
  // We use "__${cacheGroupKey}__" instead of "${cacheGroupKey}-" to make it easier to remove when generating the filename
412
- const filename = `__${cacheGroupKey}__${(0, node_path_1.basename)(chunkName)}`;
413
- const chunkDirname = (0, node_path_1.dirname)(chunkName);
414
- return chunkDirname === '.' ? filename : `${chunkDirname}/${filename}`;
335
+ const filename = `__${cacheGroupKey}__${node_path_1.default.basename(chunkName)}`;
336
+ const dirname = node_path_1.default.dirname(chunkName);
337
+ return dirname === '.' ? filename : `${dirname}/${filename}`;
415
338
  }
416
339
  },
417
340
  default: false
@@ -6,9 +6,7 @@ const node_fs_1 = require("node:fs");
6
6
  const promises_1 = require("node:fs/promises");
7
7
  const node_path_1 = require("node:path");
8
8
  const shared_1 = require("./shared");
9
- const entrypoint_resolution_logic_1 = require("./utils/entrypoint-resolution-logic");
10
9
  const common_config_helpers_1 = require("./utils/common-config-helpers");
11
- const path_query_and_related_helpers_1 = require("./utils/path-query-and-related-helpers");
12
10
  const AdditionalDependencyInjectorPlugin_1 = require("./plugins/AdditionalDependencyInjectorPlugin");
13
11
  const BrowserSyncPlugin_1 = require("./plugins/BrowserSyncPlugin");
14
12
  const dependency_extraction_webpack_plugin_config_builder_1 = require("./plugins/dependency-extraction-webpack-plugin-config-builder");
@@ -27,7 +25,6 @@ const UnifiedLoaderGenerator_1 = require("./plugins/UnifiedLoaderGenerator");
27
25
  const copy_webpack_plugin_1 = __importDefault(require("copy-webpack-plugin"));
28
26
  const fork_ts_checker_webpack_plugin_1 = __importDefault(require("fork-ts-checker-webpack-plugin"));
29
27
  const webpack_remove_empty_scripts_1 = __importDefault(require("webpack-remove-empty-scripts"));
30
- const location_encoding_filename_parser_1 = require("./utils/location-encoding-filename-parser");
31
28
  function testForDuplicatedEntryPaths(sources) {
32
29
  const seenPaths = (0, common_config_helpers_1.groupEntrypointsByAssetFile)(Array.isArray(sources)
33
30
  ? sources.map(s => typeof s === 'string' ? s : s[1].destination)
@@ -88,8 +85,8 @@ function replaceDefaultURLProcessing(useWebpackResourceFiltering) {
88
85
  return rules;
89
86
  };
90
87
  }
91
- function injectPostcssConfigOverrides(rules, config, variables, postcssFunctionsConfig, verbose) {
92
- const postcssConfig = (0, static_configs_1.postcssConfigBuilder)(verbose, name => variables(name) ?? (name === 'ENV' ? '' : undefined), postcssFunctionsConfig);
88
+ function injectPostcssConfigOverrides(rules, config, variables, postcssFunctionsConfig) {
89
+ const postcssConfig = (0, static_configs_1.postcssConfigBuilder)(name => variables(name) ?? (name === 'ENV' ? '' : undefined), postcssFunctionsConfig);
93
90
  return recursivelyAddParentDirectoryStepToImagesAndFonts(rules.map(rule => {
94
91
  if (rule && typeof rule === 'object') {
95
92
  if (Array.isArray(rule.use)) {
@@ -166,7 +163,6 @@ function injectSupportForInliningSVGsAsStrings(rules) {
166
163
  });
167
164
  }
168
165
  function buildVerifiedConfig(config) {
169
- config = (0, shared_1.applyStandards)(config);
170
166
  const { standaloneBlocks = false, stats = 'errors-warnings', variables: rawVariables, verbose = process.argv.includes('--verbose') || process.env['VERBOSE'] === 'true', postcss = {}, externals, assumeGlobalizedPlauditLibraries = true, processTranslationConfigs = true, combineAssetMetadata = true, useWebpackResourceFiltering = true, plainEntrypointsVersion = 1, srcDir = "", useUnifiedLoader = false, includePostInitFallback = false, omitDistDev = false, onlyRunPostCSSOnPCSS = false } = config;
171
167
  let outputDir = config.outputDir ?? "";
172
168
  if (outputDir && useUnifiedLoader && !omitDistDev && (process.env['SERVER_MODE'] ?? 'development') === 'development') {
@@ -192,8 +188,22 @@ function buildVerifiedConfig(config) {
192
188
  throw new Error("Plain Entrypoints V2 and higher require 'outputDir' to be set");
193
189
  }
194
190
  }
195
- const { staticEntrypoints, dynamicEntrypoints } = (0, entrypoint_resolution_logic_1.resolveAllConfigLevelEntrypoints)(config);
196
- const rawSources = [...staticEntrypoints, ...dynamicEntrypoints];
191
+ const normalizeSrcAndDestination = ([src, dest]) => {
192
+ if (srcDir) {
193
+ src = (0, node_path_1.join)(srcDir, src);
194
+ }
195
+ src = (0, node_path_1.isAbsolute)(src) ? (0, node_path_1.relative)(process.cwd(), src) : src;
196
+ if (dest.destination !== undefined && (0, node_path_1.isAbsolute)(dest.destination)) {
197
+ dest = { ...dest, destination: (0, node_path_1.relative)(process.cwd(), dest.destination) };
198
+ }
199
+ return [src, dest];
200
+ };
201
+ const rawSources = Array.isArray(config.src)
202
+ ? config.src.map(s => normalizeSrcAndDestination([s, { destination: s }]))
203
+ : Object.entries(config.src)
204
+ .map(([k, v]) => {
205
+ return normalizeSrcAndDestination([k, typeof v === 'boolean' ? {} : (typeof v === 'string' ? { destination: v } : v)]);
206
+ });
197
207
  let variablesFilePath = undefined;
198
208
  const currentVariables = rawVariables ?? {};
199
209
  if (!rawVariables) {
@@ -211,24 +221,29 @@ function buildVerifiedConfig(config) {
211
221
  // Destination -> source map
212
222
  const allocatedDestinations = {};
213
223
  const partiallyVerifiedSources = rawSources.map(rawSource => {
214
- const { destination, additionalDependencies = [], assumeGlobalizedPlauditLibraries = cfg.assumeGlobalizedPlauditLibraries, bundleAnalyzer = false, directoryLayout, externalize, withLegacyBlocksIn = false, lazyLoader, pathQueryParameters: rawPathQueryParameters, enqueuingFlags: rawEnqueuingFlags } = rawSource[1];
215
- const { flags: queryEnqueuingFlags, remainder: pathQueryParameters } = (0, path_query_and_related_helpers_1.unpackEnqueuingControlFlagsFromPathQueryParameters)(rawPathQueryParameters, rawSource[0], 'path query parameters');
216
- const enqueuingFlags = (0, path_query_and_related_helpers_1.mergeTwoEnqueuingControlFlagSets)(rawSource[0], rawEnqueuingFlags, queryEnqueuingFlags);
224
+ const { destination, additionalDependencies = [], assumeGlobalizedPlauditLibraries = cfg.assumeGlobalizedPlauditLibraries, bundleAnalyzer = false, directoryLayout, externalize, withLegacyBlocksIn = false, lazyLoader } = rawSource[1];
217
225
  const normalizedParts = { additionalDependencies, assumeGlobalizedPlauditLibraries, bundleAnalyzer, directoryLayout, externalize, withLegacyBlocksIn, lazyLoader };
218
226
  const locations = typeof rawSource[1].locations === 'string' || typeof rawSource[1].locations === 'function'
219
227
  ? { handle: rawSource[1].locations } : rawSource[1].locations ?? {};
220
- if (typeof locations.registerScriptArgs === 'string' && !['lazy', 'eager', 'inline'].includes(locations.registerScriptArgs)) {
221
- throw new ReferenceError("The only supported string values for registerScriptArgs are 'lazy', 'eager', and 'inline'");
228
+ let normalizedLocations;
229
+ if ((0, shared_1.isNormalizedUsageLocations)(locations)) {
230
+ normalizedLocations = locations;
231
+ }
232
+ else if (locations.registerScriptArgs === 'lazy') {
233
+ normalizedLocations = { ...locations, registerScriptArgs: { strategy: 'defer', in_footer: true } };
234
+ }
235
+ else {
236
+ throw new ReferenceError("The only supported string value for registerScript args is 'lazy'");
222
237
  }
223
238
  if (destination !== undefined) {
224
239
  const effectiveDestination = toEffectiveWebpackDestination(destination);
225
- allocatedDestinations[effectiveDestination] = rawSource[0]; // We need to pre-populate the allocatedDestinations map with statically declared destinations
226
- return [rawSource[0], { ...normalizedParts, locations, destination, effectiveDestination, staticallyDeclaredDestination: true, pathQueryParameters, enqueuingFlags }];
240
+ allocatedDestinations[effectiveDestination] = rawSource[0]; // We need to pre-populate the allocatedDestinations map with statically-declared destinations
241
+ return [rawSource[0], { ...normalizedParts, locations: normalizedLocations, destination, effectiveDestination, staticallyDeclaredDestination: true }];
227
242
  }
228
243
  else {
229
244
  const naiveDestination = deriveNaiveDestinationFromUnverifiedSourceEntry(rawSource, srcPrefixes);
230
245
  const effectiveDestination = toEffectiveWebpackDestination(naiveDestination);
231
- return [rawSource[0], { ...normalizedParts, locations, destination: naiveDestination, effectiveDestination, staticallyDeclaredDestination: false, pathQueryParameters, enqueuingFlags }];
246
+ return [rawSource[0], { ...normalizedParts, locations: normalizedLocations, destination: naiveDestination, effectiveDestination, staticallyDeclaredDestination: false }];
232
247
  }
233
248
  });
234
249
  const dynamicEffectiveDestinationsWithExpectedNaiveDuplicates = partiallyVerifiedSources
@@ -426,7 +441,7 @@ function commonConfigProcessingPrep(config, webpackConfig) {
426
441
  const fixedRules = [
427
442
  replaceDefaultURLProcessing(config.useWebpackResourceFiltering),
428
443
  (rules) => {
429
- return injectPostcssConfigOverrides(rules, config, name => currentVariables[name], config.postcss.functions ?? (() => ({})), config.verbose);
444
+ return injectPostcssConfigOverrides(rules, config, name => currentVariables[name], config.postcss.functions ?? (() => ({})));
430
445
  },
431
446
  injectSupportForInliningSVGsAsStrings
432
447
  ].reduce((r, a) => a(r), webpackConfig.module?.rules ?? []);
@@ -507,22 +522,12 @@ function processIndividualWebpackConfig(config, webpackConfig, sources, canClean
507
522
  const entry = async () => {
508
523
  const rawEntrypoints = [];
509
524
  for await (const dirent of await (0, promises_1.opendir)(srcRoot)) {
510
- if (dirent.name.startsWith("~")) {
511
- continue;
512
- }
513
- if (dirent.isFile()) {
514
- if ((commonConfig.scriptExtension.test(dirent.name) || shared_1.styleExtension.test(dirent.name))) {
525
+ if (dirent.isFile() && !dirent.name.startsWith("~")) {
526
+ if (commonConfig.scriptExtension.test(dirent.name) || shared_1.styleExtension.test(dirent.name)) {
515
527
  const absoluteSrc = (0, common_config_helpers_1.joinPossiblyAbsolutePaths)(srcRoot, dirent.name);
516
- const extensionId = (0, node_path_1.parse)(dirent.name).name;
517
- rawEntrypoints.push([(0, node_path_1.join)(dest.destination, (0, node_path_1.basename)(absoluteSrc, (0, node_path_1.extname)(absoluteSrc))), {
518
- import: [absoluteSrc],
519
- plauditMetadata: { dest, absoluteSrc, extensionId }
520
- }]);
528
+ rawEntrypoints.push([(0, node_path_1.join)(dest.destination, (0, node_path_1.basename)(absoluteSrc, (0, node_path_1.extname)(absoluteSrc))), { import: [absoluteSrc], plauditMetadata: { dest, absoluteSrc } }]);
521
529
  }
522
530
  }
523
- else if (dirent.isDirectory()) {
524
- rawEntrypoints.push(...await walkExtensionsTree((0, node_path_1.join)(srcRoot, dirent.name), dest, [dirent.name]));
525
- }
526
531
  }
527
532
  return Object.fromEntries(rawEntrypoints);
528
533
  };
@@ -563,7 +568,7 @@ function processIndividualWebpackConfig(config, webpackConfig, sources, canClean
563
568
  if (canCopyFiles) {
564
569
  plugins.push(new copy_webpack_plugin_1.default({
565
570
  patterns: [{
566
- from: config.standaloneBlocks ? '**/*.(php|twig|svg)' : '**/*.(asset\.php|svg)', //TODO: I'm pretty sure that the dots need proper escaping
571
+ from: config.standaloneBlocks ? '**/*.(php|twig|svg)' : '**/*.(asset\.php|svg)',
567
572
  to: dest.destination,
568
573
  context: srcRoot /* canCopyFiles can only be true if srcRoot is a string, so this is safe */, noErrorOnMissing: true
569
574
  }]
@@ -574,45 +579,6 @@ function processIndividualWebpackConfig(config, webpackConfig, sources, canClean
574
579
  return (0, common_config_helpers_1.commonMakeWebpackConfig)(config, commonConfig, webpackConfig, externalize, plugins, canClean && batches.length < 2);
575
580
  }).filter(cfg => cfg !== undefined);
576
581
  }
577
- async function walkExtensionsTree(srcRoot, dest, parents) {
578
- const res = [];
579
- for await (const dirent of await (0, promises_1.opendir)(srcRoot)) {
580
- if (dirent.name.startsWith("~")) {
581
- continue;
582
- }
583
- if (dirent.isFile()) {
584
- const parsedFilename = (0, location_encoding_filename_parser_1.parseLocationEncodingFilename)(dirent.name);
585
- if (parsedFilename === undefined) {
586
- continue;
587
- }
588
- const absoluteSrc = (0, common_config_helpers_1.joinPossiblyAbsolutePaths)(srcRoot, dirent.name);
589
- let destFile;
590
- if (Object.keys(parsedFilename.locations).length === 1) {
591
- if (parsedFilename.locations.clientView) {
592
- destFile = `view-${parsedFilename.type}`;
593
- }
594
- else if (parsedFilename.locations.clientEditor) {
595
- destFile = `editor-${parsedFilename.type}`;
596
- }
597
- else {
598
- destFile = (0, node_path_1.basename)(absoluteSrc, (0, node_path_1.extname)(absoluteSrc));
599
- }
600
- }
601
- else {
602
- destFile = (0, node_path_1.basename)(absoluteSrc, (0, node_path_1.extname)(absoluteSrc));
603
- }
604
- const extensionId = parents.join("-") + "-" + destFile;
605
- res.push([(0, node_path_1.join)(dest.destination, ...parents, destFile), {
606
- import: [absoluteSrc],
607
- plauditMetadata: { dest, absoluteSrc, extensionId }
608
- }]);
609
- }
610
- else if (dirent.isDirectory()) {
611
- res.push(...await walkExtensionsTree((0, node_path_1.join)(srcRoot, dirent.name), dest, [...parents, dirent.name]));
612
- }
613
- }
614
- return res;
615
- }
616
582
  function stripExtension(filepath) {
617
583
  return (0, node_path_1.join)((0, node_path_1.dirname)(filepath), (0, node_path_1.basename)(filepath, (0, node_path_1.extname)(filepath)));
618
584
  }
package/package.json CHANGED
@@ -1,82 +1,73 @@
1
1
  {
2
2
  "name": "@plaudit/webpack-extensions",
3
- "version": "2.89.2",
3
+ "version": "3.0.0-rc.2",
4
4
  "license": "SEE LICENSE IN LICENSE.md",
5
5
  "files": [
6
- "/dist",
6
+ "/build",
7
7
  "README.md",
8
8
  "LICENSE.md",
9
9
  "CHANGELOG.md",
10
10
  "USER-GUIDE.md"
11
11
  ],
12
12
  "exports": {
13
- "./wordpress-scripts-wrapper": "./dist/wordpress-scripts-wrapper.js",
14
- "./location-encoding-filename-parser": "./dist/utils/location-encoding-filename-parser.js",
15
- "./shared": "./dist/shared.js"
13
+ "./wordpress-scripts-wrapper": "./build/wordpress-scripts-wrapper.js",
14
+ "./shared": "./build/shared.js"
16
15
  },
17
16
  "typesVersions": {
18
17
  "*": {
19
18
  "wordpress-scripts-wrapper": [
20
- "dist/wordpress-scripts-wrapper.d.ts"
21
- ],
22
- "location-encoding-filename-parser": [
23
- "dist/location-encoding-filename-parser.d.ts"
19
+ "build/wordpress-scripts-wrapper.d.ts"
24
20
  ],
25
21
  "shared": [
26
- "dist/shared.d.ts"
22
+ "build/shared.d.ts"
27
23
  ]
28
24
  }
29
25
  },
30
26
  "devDependencies": {
31
- "@plaudit/gutenberg-api-extensions": "^2.94.1",
27
+ "@plaudit/gutenberg-api-extensions": "^2.85.0",
32
28
  "@types/browser-sync-webpack-plugin": "^2.2.5",
33
- "@types/node": "^25.6.0",
29
+ "@types/node": "^25.2.3",
34
30
  "@types/postcss-functions": "^4.0.4",
31
+ "@types/postcss-import": "^14.0.3",
35
32
  "@types/tapable": "^2.3.0",
36
33
  "@types/webpack-sources": "^3.2.3",
37
- "postcss-load-config": "^4.0.2",
38
- "postcss-loader": "^7.3.4",
39
- "typescript": "^6.0.3",
40
- "webpack-bundle-analyzer": "^4.10.2"
34
+ "typescript": "^5.9.3",
35
+ "webpack-bundle-analyzer": "^5.2.0"
41
36
  },
42
37
  "dependencies": {
43
- "@plaudit/php-writer": "^1.4.1",
38
+ "@plaudit/php-writer": "^1.3.3",
44
39
  "@plaudit/postcss-color-function": "^5.0.0",
45
- "@plaudit/postcss-legacy-shorthand": "^1.0.0",
46
- "@plaudit/postcss-silent-extend": "^3.0.0",
47
40
  "@plaudit/postcss-strip-units": "^3.0.0",
48
- "@plaudit/postcss-variables": "^1.1.0",
49
- "@wordpress/dependency-extraction-webpack-plugin": "^6.44.0",
50
- "@wordpress/scripts": "^32.0.0",
51
- "autoprefixer": "^10.5.0",
41
+ "@plaudit/postcss-variables": "^2.0.0",
42
+ "@wordpress/dependency-extraction-webpack-plugin": "^6.39.0",
43
+ "@wordpress/scripts": "^31.4.0",
44
+ "autoprefixer": "^10.4.24",
52
45
  "browser-sync": "^3.0.4",
53
46
  "copy-webpack-plugin": "10.2.4",
54
- "css-minimizer-webpack-plugin": "^6.0.0",
47
+ "css-minimizer-webpack-plugin": "^7.0.4",
48
+ "cssnano": "^7.1.2",
55
49
  "fork-ts-checker-webpack-plugin": "^9.1.0",
56
50
  "http-proxy-middleware": "^3.0.5",
57
51
  "json2php": "^0.0.12",
58
- "postcss": "^8.5.12",
59
- "postcss-calc": "^9.0.1",
60
- "postcss-discard-comments": "^6.0.2",
52
+ "postcss": "^8.5.6",
53
+ "postcss-calc": "^10.1.1",
61
54
  "postcss-functions": "^4.0.2",
62
55
  "postcss-import": "^16.1.1",
63
- "postcss-media-minmax": "^5.0.0",
64
- "postcss-mixins": "6.2.3",
65
- "postcss-nested": "^6.2.0",
56
+ "postcss-loader": "^8.2.0",
57
+ "postcss-mixins": "^12.1.2",
58
+ "postcss-nested": "^7.0.2",
66
59
  "postcss-property-lookup": "^3.0.0",
67
60
  "postcss-reporter": "^7.1.0",
68
- "postcss-simple-vars": "^7.0.1",
69
- "postcss-url": "^10.1.3",
70
- "webpack": "^5.106.2",
61
+ "webpack": "^5.105.2",
71
62
  "webpack-remove-empty-scripts": "^1.1.1",
72
- "xml-formatter": "^3.7.0"
63
+ "xml-formatter": "^3.6.7"
73
64
  },
74
65
  "engines": {
75
66
  "node": ">=20"
76
67
  },
77
68
  "scripts": {
78
69
  "build": "tsc",
79
- "clean": "rm -rf dist",
70
+ "clean": "rm -rf build",
80
71
  "build:clean": "pnpm run clean && pnpm run build",
81
72
  "watch": "tsc -w"
82
73
  }
@@ -1,3 +0,0 @@
1
- import type { Options as PostcssFunctionsOptions } from "postcss-functions";
2
- import type { PostCSSLoaderOptions } from "postcss-loader/dist/config";
3
- export declare function postcssConfigBuilder(verbose: boolean, variables: (name: string) => string | undefined, postCSSFunctions: (variables: (name: string) => unknown) => PostcssFunctionsOptions['functions']): PostCSSLoaderOptions;