@plaudit/webpack-extensions 2.1.1 → 2.1.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.
@@ -1,2 +1,2 @@
1
1
  import type { PostCSSLoaderOptions } from "postcss-loader/dist/config";
2
- export declare function postcssConfigBuilder(verbose: boolean, legacyPostcssPlugins: boolean, variables: (name: string) => string | undefined): PostCSSLoaderOptions;
2
+ export declare function postcssConfigBuilder(verbose: boolean, variables: (name: string) => string | undefined): PostCSSLoaderOptions;
@@ -57,20 +57,18 @@ const nanoConfig = {
57
57
  }
58
58
  ]
59
59
  };
60
- function postcssConfigBuilder(verbose, legacyPostcssPlugins, variables) {
60
+ function postcssConfigBuilder(verbose, variables) {
61
61
  return {
62
62
  plugins: [
63
63
  require("postcss-import")(),
64
64
  require("@plaudit/postcss-silent-extend")({ warnOfUnused: verbose }),
65
65
  require("postcss-mixins")(),
66
66
  require("@plaudit/postcss-variables")({ variables }),
67
- ...(legacyPostcssPlugins ? [
68
- require("postcss-quantity-queries")(),
69
- require("postcss-short-position")(),
70
- require("postcss-short-size")(),
71
- require("postcss-short-spacing")(),
72
- require("postcss-fallback")() // Legacy
73
- ] : []),
67
+ require("postcss-quantity-queries")(),
68
+ require("postcss-short-position")(),
69
+ require("postcss-short-size")(),
70
+ require("postcss-short-spacing")(),
71
+ require("postcss-fallback")(),
74
72
  require("postcss-property-lookup")({ logLevel: "warn" }),
75
73
  require("@plaudit/postcss-strip-units")(),
76
74
  require("postcss-media-minmax")(),
@@ -1,6 +1,5 @@
1
1
  import type { Configuration } from "webpack";
2
2
  interface PlauditWordpressWebpackConfig {
3
- legacyPostcssPlugins?: boolean;
4
3
  variables?: Record<string, any>;
5
4
  verbose?: boolean;
6
5
  src: string[] | Record<string, string>;
@@ -59,7 +59,7 @@ module.exports = function (config, webpackConfig = require("@wordpress/scripts/c
59
59
  console.error(`Encountered multiple paths that produce the same effective bundle name:${duplicatedPaths}`);
60
60
  process.exit(1);
61
61
  }
62
- const { legacyPostcssPlugins = false, variables = ["variables.js", "preprocess/variables.js"].map(p => node_path_1.default.join(process.cwd(), p)).filter(p => node_fs_1.default.existsSync(p)).map(p => require(p))[0] ?? {}, verbose = process.argv.includes('--verbose') || process.env['VERBOSE'] === 'true' } = config;
62
+ const { variables = ["variables.js", "preprocess/variables.js"].map(p => node_path_1.default.join(process.cwd(), p)).filter(p => node_fs_1.default.existsSync(p)).map(p => require(p))[0] ?? {}, verbose = process.argv.includes('--verbose') || process.env['VERBOSE'] === 'true' } = config;
63
63
  const cssLoader = require.resolve('css-loader');
64
64
  if (cssLoader && webpackConfig.module?.rules) {
65
65
  for (const rule of webpackConfig.module.rules) {
@@ -74,7 +74,7 @@ module.exports = function (config, webpackConfig = require("@wordpress/scripts/c
74
74
  }
75
75
  let currentEntrypoint = '';
76
76
  if (webpackConfig.module?.rules) {
77
- const postcssConfig = (0, static_configs_1.postcssConfigBuilder)(verbose, legacyPostcssPlugins, (name) => {
77
+ const postcssConfig = (0, static_configs_1.postcssConfigBuilder)(verbose, (name) => {
78
78
  if (variables[name]) {
79
79
  return variables[name];
80
80
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plaudit/webpack-extensions",
3
- "version": "2.1.1",
3
+ "version": "2.1.2",
4
4
  "scripts": {
5
5
  "prepublishOnly": "rm -rf build && mkdir build && tsc",
6
6
  "build": "tsc",
@@ -56,7 +56,7 @@
56
56
  "postcss-simple-vars": "^7.0.1",
57
57
  "react": "^18.2.0",
58
58
  "react-dom": "^18.2.0",
59
- "webpack": "^5.87.0",
59
+ "webpack": "^5.88.0",
60
60
  "webpack-remove-empty-scripts": "^1.0.3",
61
61
  "webpack-sources": "^3.2.3"
62
62
  },