@itcase/config 1.7.22 → 1.7.23

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@itcase/config",
3
- "version": "1.7.22",
3
+ "version": "1.7.23",
4
4
  "author": "ITCase",
5
5
  "description": "ITCase Config",
6
6
  "engines": {
@@ -1,4 +1,12 @@
1
- /* eslint-disable perfectionist/sort-objects */
1
+ import path from 'node:path'
2
+ import { fileURLToPath } from 'node:url'
3
+
4
+ // Next.js loads each plugin with require(name) and does not unwrap ESM
5
+ // default exports. These two packages are ESM-only, so the keys are CJS
6
+ // wrappers next to this file that export the plugin function.
7
+ const directory = path.dirname(fileURLToPath(import.meta.url))
8
+
9
+ /* eslint-disable import/no-default-export, perfectionist/sort-objects */
2
10
  export default {
3
11
  plugins: {
4
12
  'postcss-normalize': {},
@@ -43,14 +51,14 @@ export default {
43
51
  filter: /\.(svg|png)$/,
44
52
  },
45
53
  'postcss-nested-ancestors': {},
46
- 'postcss-nested': {},
54
+ [path.join(directory, 'postcss-nested.cjs')]: {},
47
55
  'postcss-hexrgba': {},
48
56
  'postcss-easings': {},
49
57
  'postcss-dark-theme-class': {
50
58
  darkSelector: '.dark-theme',
51
59
  lightSelector: '.light-theme',
52
60
  },
53
- 'postcss-combine-duplicated-selectors': {},
61
+ [path.join(directory, 'postcss-combine-duplicated-selectors.cjs')]: {},
54
62
  'postcss-discard-duplicates': {},
55
63
  'postcss-pxtorem': {
56
64
  minPixelValue: 0,
@@ -0,0 +1,10 @@
1
+ /* eslint-disable @typescript-eslint/no-require-imports */
2
+
3
+ // "postcss-combine-duplicated-selectors@v11.0.0" is ESM;
4
+ // CJS require() returns "{ default: fn }", build failed with
5
+ // "Cannot convert object to primitive value"
6
+ const postcssCombineDuplicatedSelectors =
7
+ require('postcss-combine-duplicated-selectors').default ||
8
+ require('postcss-combine-duplicated-selectors')
9
+
10
+ module.exports = postcssCombineDuplicatedSelectors
@@ -0,0 +1,7 @@
1
+ /* eslint-disable @typescript-eslint/no-require-imports */
2
+
3
+ // "postcss-nested@8" is ESM; CJS require() returns "{ default: fn }"
4
+ const postcssNested =
5
+ require('postcss-nested').default || require('postcss-nested')
6
+
7
+ module.exports = postcssNested