stylex-webpack 0.2.1-beta.6 → 0.3.0

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/index.js CHANGED
@@ -128,7 +128,7 @@ class StyleXPlugin {
128
128
  }
129
129
  }
130
130
  // Let's find the css file that belongs to the stylex chunk
131
- const cssAssetDetails = Object.entries(assets).find(([assetName])=>stylexChunk.files.has(assetName));
131
+ const cssAssetDetails = Object.entries(assets).find(([assetName])=>stylexChunk.files.has(assetName) && assetName.includes(STYLEX_CHUNK_NAME));
132
132
  if (!cssAssetDetails) {
133
133
  return;
134
134
  }
@@ -12,6 +12,11 @@ function stylexVirtualCssLoader(inputCode, inputSourceMap) {
12
12
  callback(null, inputCode, inputSourceMap);
13
13
  return;
14
14
  }
15
+ // If we got stylex in the virtual css import, we need to disable the cache
16
+ // to fix HMR and Next.js navigation
17
+ // TODO: find a better way to mark the generated chunk as uncacheable instead
18
+ // of disable caching the result of this loader
19
+ this.cacheable(false);
15
20
  // @ts-expect-error -- getHashDigest supports string & xxhash64
16
21
  const hash = loaderUtils.getHashDigest(stylex, 'xxhash64', 'base62', 32);
17
22
  const css = `
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "stylex-webpack",
3
- "version": "0.2.1-beta.6",
3
+ "version": "0.3.0",
4
4
  "description": "The another Webpack Plugin for Facebook's StyleX",
5
5
  "homepage": "https://github.com/SukkaW/style9-webpack#readme",
6
6
  "repository": {
@@ -38,43 +38,43 @@
38
38
  "author": "Sukka <https://skk.moe>",
39
39
  "license": "MIT",
40
40
  "dependencies": {
41
- "@babel/core": "^7.23.9",
42
- "@babel/plugin-syntax-jsx": "^7.23.3",
43
- "@babel/plugin-syntax-typescript": "^7.23.3",
41
+ "@babel/core": "^7.24.4",
42
+ "@babel/plugin-syntax-jsx": "^7.24.1",
43
+ "@babel/plugin-syntax-typescript": "^7.24.1",
44
44
  "@stylexjs/babel-plugin": "^0.5.1",
45
45
  "loader-utils": "^3.2.1"
46
46
  },
47
47
  "devDependencies": {
48
- "@eslint-sukka/node": "^5.1.0",
49
- "@eslint-sukka/ts": "^5.1.0",
50
- "@swc-node/register": "^1.8.0",
51
- "@swc/core": "^1.4.1",
48
+ "@eslint-sukka/node": "^5.1.2",
49
+ "@eslint-sukka/ts": "^5.1.2",
50
+ "@swc-node/register": "^1.9.0",
51
+ "@swc/core": "^1.4.12",
52
52
  "@types/babel__core": "^7.20.5",
53
- "@types/chai": "^4.3.11",
53
+ "@types/chai": "^4.3.14",
54
54
  "@types/loader-utils": "^2.0.6",
55
55
  "@types/mocha": "^10.0.6",
56
- "@types/node": "^20.11.17",
56
+ "@types/node": "^20.12.4",
57
57
  "browserslist": "^4.23.0",
58
58
  "bumpp": "^9.3.0",
59
59
  "chai": "^4.4.1",
60
60
  "css-loader": "^6.10.0",
61
- "eslint": "^8.56.0",
62
- "eslint-config-sukka": "^5.1.0",
63
- "eslint-formatter-sukka": "^5.1.0",
64
- "memfs": "^4.7.0",
65
- "mini-css-extract-plugin": "^2.8.0",
66
- "mocha": "^10.3.0",
61
+ "eslint": "^8.57.0",
62
+ "eslint-config-sukka": "^5.1.2",
63
+ "eslint-formatter-sukka": "^5.1.2",
64
+ "memfs": "^4.8.1",
65
+ "mini-css-extract-plugin": "^2.8.1",
66
+ "mocha": "^10.4.0",
67
67
  "mocha-chai-jest-snapshot": "^1.1.4",
68
- "next": "^14.1.0",
69
- "postcss": "^8.4.35",
68
+ "next": "^14.1.4",
69
+ "postcss": "^8.4.38",
70
70
  "rimraf": "^5.0.5",
71
- "rollup": "^4.10.0",
71
+ "rollup": "^4.14.0",
72
72
  "rollup-plugin-copy": "^3.5.0",
73
73
  "rollup-plugin-dts": "^6.1.0",
74
74
  "rollup-plugin-swc3": "^0.11.0",
75
75
  "swc-loader": "^0.2.6",
76
- "typescript": "^5.3.3",
77
- "webpack": "^5.90.1"
76
+ "typescript": "^5.4.4",
77
+ "webpack": "^5.91.0"
78
78
  },
79
79
  "peerDependencies": {
80
80
  "@stylexjs/stylex": "*"