@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.
@@ -308,22 +308,23 @@ function createWorkerRule(options) {
308
308
  };
309
309
  }
310
310
  function createSassStylesRule(options) {
311
- const loaders = getCssLoaders(options);
312
- loaders.push({
313
- loader: require.resolve('resolve-url-loader'),
314
- options: {
315
- sourceMap: !options.config.disableSourceMapGeneration,
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
- loaders.push({
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],
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 (isEnvProduction) {
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('style-loader'),
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
- loaders.push({
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: 2,
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 (!config.transformCssWithLightningCss) {
365
- loaders.push({
366
- loader: require.resolve('postcss-loader'),
367
- options: {
368
- sourceMap: !config.disableSourceMapGeneration,
369
- postcssOptions: {
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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gravity-ui/app-builder",
3
- "version": "0.13.0",
3
+ "version": "0.13.1",
4
4
  "description": "Develop and build your React client-server projects, powered by typescript and webpack",
5
5
  "license": "MIT",
6
6
  "type": "commonjs",