sku 13.0.3 → 13.0.4

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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # sku
2
2
 
3
+ ## 13.0.4
4
+
5
+ ### Patch Changes
6
+
7
+ - Fixes a bug preventing `.mdx` files from loading in Storybook when using `sku`'s `webpackFinal` Storybook configuration ([#1032](https://github.com/seek-oss/sku/pull/1032))
8
+
3
9
  ## 13.0.3
4
10
 
5
11
  ### Patch Changes
@@ -5,6 +5,9 @@ const { resolvePackage } = require('../webpack/utils/resolvePackage');
5
5
 
6
6
  const hot = process.env.SKU_HOT !== 'false';
7
7
 
8
+ const EXAMPLE_CSS_FILE = 'example.css';
9
+ const EXAMPLE_MDX_FILE = 'example.mdx';
10
+
8
11
  /**
9
12
  * @param {import("webpack").Configuration} config
10
13
  * @param {{isDevServer: boolean}}
@@ -24,11 +27,33 @@ module.exports = (config, { isDevServer }) => {
24
27
  ...(Array.isArray(previousExclude)
25
28
  ? previousExclude
26
29
  : [previousExclude]), // Ensure we don't clobber any existing exclusions
27
- ...paths.src,
28
- ...paths.compilePackages.map(resolvePackage),
29
- /\.vanilla\.css$/, // Vanilla Extract virtual modules
30
- /\.css$/, // external CSS
31
30
  ];
31
+
32
+ if (rule.test instanceof RegExp) {
33
+ // Only exclude sku app source code and compile packages if the rule is not for MDX files
34
+ if (!rule.test.test(EXAMPLE_MDX_FILE)) {
35
+ rule.exclude.push(
36
+ ...paths.src,
37
+ ...paths.compilePackages.map(resolvePackage),
38
+ );
39
+ }
40
+
41
+ // Only exclude vanilla extract virtual CSS files if the rule is for CSS files
42
+ if (rule.test.test(EXAMPLE_CSS_FILE)) {
43
+ rule.exclude.push(
44
+ /\.vanilla\.css$/, // Vanilla Extract virtual modules
45
+ /\.css$/, // external CSS
46
+ );
47
+ }
48
+ } else {
49
+ // To be safe, exclude everything if the rule's test isn't a RegExp
50
+ rule.exclude.push(
51
+ ...paths.src,
52
+ ...paths.compilePackages.map(resolvePackage),
53
+ /\.vanilla\.css$/, // Vanilla Extract virtual modules
54
+ /\.css$/, // external CSS
55
+ );
56
+ }
32
57
  });
33
58
  }
34
59
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sku",
3
- "version": "13.0.3",
3
+ "version": "13.0.4",
4
4
  "description": "Front-end development toolkit, powered by Webpack, Babel, Vanilla Extract and Jest",
5
5
  "types": "./sku-types.d.ts",
6
6
  "bin": {