@gravity-ui/app-builder 0.13.0 → 0.13.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/common/webpack/config.js +38 -33
- package/package.json +1 -1
|
@@ -308,22 +308,23 @@ function createWorkerRule(options) {
|
|
|
308
308
|
};
|
|
309
309
|
}
|
|
310
310
|
function createSassStylesRule(options) {
|
|
311
|
-
const loaders = getCssLoaders(options
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
311
|
+
const loaders = getCssLoaders(options, [
|
|
312
|
+
{
|
|
313
|
+
loader: require.resolve('resolve-url-loader'),
|
|
314
|
+
options: {
|
|
315
|
+
sourceMap: !options.config.disableSourceMapGeneration,
|
|
316
|
+
},
|
|
316
317
|
},
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
318
|
+
{
|
|
319
|
+
loader: require.resolve('sass-loader'),
|
|
320
|
+
options: {
|
|
321
|
+
sourceMap: true, // must be always true for work with resolve-url-loader
|
|
322
|
+
sassOptions: {
|
|
323
|
+
loadPaths: [paths_1.default.appClient],
|
|
324
|
+
},
|
|
324
325
|
},
|
|
325
326
|
},
|
|
326
|
-
|
|
327
|
+
]);
|
|
327
328
|
return {
|
|
328
329
|
test: /\.scss$/,
|
|
329
330
|
sideEffects: options.isEnvProduction ? true : undefined,
|
|
@@ -338,22 +339,32 @@ function createStylesRule(options) {
|
|
|
338
339
|
use: loaders,
|
|
339
340
|
};
|
|
340
341
|
}
|
|
341
|
-
function getCssLoaders({ isEnvDevelopment, isEnvProduction, config }) {
|
|
342
|
+
function getCssLoaders({ isEnvDevelopment, isEnvProduction, config }, additionalRules) {
|
|
342
343
|
const loaders = [];
|
|
343
|
-
if (
|
|
344
|
-
loaders.push(mini_css_extract_plugin_1.default.loader);
|
|
345
|
-
}
|
|
346
|
-
if (isEnvDevelopment) {
|
|
344
|
+
if (!config.transformCssWithLightningCss) {
|
|
347
345
|
loaders.push({
|
|
348
|
-
loader: require.resolve('
|
|
346
|
+
loader: require.resolve('postcss-loader'),
|
|
347
|
+
options: {
|
|
348
|
+
sourceMap: !config.disableSourceMapGeneration,
|
|
349
|
+
postcssOptions: {
|
|
350
|
+
config: false,
|
|
351
|
+
plugins: [
|
|
352
|
+
[require.resolve('postcss-preset-env'), { enableClientSidePolyfills: false }],
|
|
353
|
+
],
|
|
354
|
+
},
|
|
355
|
+
},
|
|
349
356
|
});
|
|
350
357
|
}
|
|
351
|
-
|
|
358
|
+
if (Array.isArray(additionalRules) && additionalRules.length > 0) {
|
|
359
|
+
loaders.push(...additionalRules);
|
|
360
|
+
}
|
|
361
|
+
const importLoaders = loaders.length;
|
|
362
|
+
loaders.unshift({
|
|
352
363
|
loader: require.resolve('css-loader'),
|
|
353
364
|
options: {
|
|
354
365
|
esModule: false,
|
|
355
366
|
sourceMap: !config.disableSourceMapGeneration,
|
|
356
|
-
importLoaders
|
|
367
|
+
importLoaders,
|
|
357
368
|
modules: {
|
|
358
369
|
auto: true,
|
|
359
370
|
localIdentName: '[name]__[local]--[hash:base64:5]',
|
|
@@ -361,18 +372,12 @@ function getCssLoaders({ isEnvDevelopment, isEnvProduction, config }) {
|
|
|
361
372
|
},
|
|
362
373
|
},
|
|
363
374
|
});
|
|
364
|
-
if (
|
|
365
|
-
loaders.
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
config: false,
|
|
371
|
-
plugins: [
|
|
372
|
-
[require.resolve('postcss-preset-env'), { enableClientSidePolyfills: false }],
|
|
373
|
-
],
|
|
374
|
-
},
|
|
375
|
-
},
|
|
375
|
+
if (isEnvProduction) {
|
|
376
|
+
loaders.unshift(mini_css_extract_plugin_1.default.loader);
|
|
377
|
+
}
|
|
378
|
+
if (isEnvDevelopment) {
|
|
379
|
+
loaders.unshift({
|
|
380
|
+
loader: require.resolve('style-loader'),
|
|
376
381
|
});
|
|
377
382
|
}
|
|
378
383
|
return loaders;
|