stylex-webpack 0.4.9 → 0.4.10

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
@@ -5,7 +5,7 @@ var path = require('node:path');
5
5
  var process = require('node:process');
6
6
  var identity = require('foxts/identity');
7
7
 
8
- var version = "0.4.9";
8
+ var version = "0.4.10";
9
9
 
10
10
  const PLUGIN_NAME = 'stylex';
11
11
  const VIRTUAL_ENTRYPOINT_CSS_PATH = require.resolve('./stylex.css');
@@ -215,9 +215,11 @@ class StyleXPlugin {
215
215
  stylexImports,
216
216
  stylexOption: {
217
217
  dev: process.env.NODE_ENV === 'development',
218
- useRemForFontSize: true,
218
+ // useRemForFontSize: true,
219
+ enableFontSizePxToRem: true,
219
220
  runtimeInjection: false,
220
- genConditionalClasses: true,
221
+ // genConditionalClasses: true,
222
+ enableInlinedConditionalMerge: true,
221
223
  treeshakeCompensation: true,
222
224
  importSources: stylexImports,
223
225
  ...stylexOption
@@ -3,6 +3,7 @@
3
3
  var core = require('@babel/core');
4
4
  var stylexBabelPlugin = require('@stylexjs/babel-plugin');
5
5
  var guard = require('foxts/guard');
6
+ var path = require('node:path');
6
7
 
7
8
  const LOADER_TRANSFORMED_FLAG = '/* [stylex-webpack] stylex-loader transformed */';
8
9
  require.resolve('./stylex.css');
@@ -57,8 +58,9 @@ async function stylexLoader(inputCode, inputSourceMap) {
57
58
  stylexRules: metadata.stylex
58
59
  };
59
60
  // Add a dummy virtual import that will be picked up by virtual dummy import loader to add fake CSS to invalidate HMR
61
+ const from = path.relative(this.rootContext, this.resourcePath);
60
62
  const urlParams = new URLSearchParams({
61
- from: this.resourcePath,
63
+ from,
62
64
  stylex: JSON.stringify(metadata.stylex) // color: #fff is not url safe, let's get through JSON.stringify
63
65
  });
64
66
  const virtualCssRequest = stringifyRequest(this, `${VIRTUAL_STYLEX_CSS_DUMMY_IMPORT_PATH}?${urlParams.toString()}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "stylex-webpack",
3
- "version": "0.4.9",
3
+ "version": "0.4.10",
4
4
  "description": "The another Webpack Plugin for Facebook's StyleX",
5
5
  "homepage": "https://github.com/SukkaW/style9-webpack#readme",
6
6
  "repository": {
@@ -32,8 +32,8 @@
32
32
  "prebuild": "premove dist",
33
33
  "build": "rollup -c rollup.config.ts --configPlugin swc3 --bundleConfigAsCjs",
34
34
  "lint": "eslint --format=sukka .",
35
- "test": "mocha --require @swc-node/register --require mocha-expect-snapshot test/index.ts",
36
- "test:update": "mocha --update --require @swc-node/register test/index.ts",
35
+ "test": "mocha --require @swc-node/register test/index.ts",
36
+ "test:update": "UPDATE_SNAPSHOTS=true mocha --require @swc-node/register test/index.ts",
37
37
  "prerelease": "pnpm run build && pnpm run lint",
38
38
  "release": "bumpp -r --all --commit \"release: %s\" --tag \"%s\""
39
39
  },
@@ -49,48 +49,48 @@
49
49
  "author": "Sukka <https://skk.moe>",
50
50
  "license": "MIT",
51
51
  "dependencies": {
52
- "@babel/core": "^7.28.5",
53
- "@babel/plugin-syntax-jsx": "^7.27.1",
54
- "@babel/plugin-syntax-typescript": "^7.27.1",
52
+ "@babel/core": "^7.29.0",
53
+ "@babel/plugin-syntax-jsx": "^7.28.6",
54
+ "@babel/plugin-syntax-typescript": "^7.28.6",
55
55
  "@types/webpack": "^5.28.5",
56
- "foxts": "^5.0.4",
56
+ "foxts": "^5.3.0",
57
57
  "loader-utils": "^3.3.1"
58
58
  },
59
59
  "devDependencies": {
60
- "@eslint-sukka/node": "^8.1.0",
60
+ "@eslint-sukka/node": "^8.7.0",
61
61
  "@rollup/plugin-json": "^6.1.0",
62
62
  "@swc-node/register": "^1.11.1",
63
- "@swc/core": "^1.15.8",
63
+ "@swc/core": "^1.15.17",
64
64
  "@types/babel__core": "^7.20.5",
65
65
  "@types/loader-utils": "^3.0.0",
66
66
  "@types/mocha": "^10.0.10",
67
- "@types/node": "^22.19.3",
67
+ "@types/node": "^22.19.13",
68
68
  "browserslist": "^4.28.1",
69
- "bumpp": "^10.3.2",
70
- "css-loader": "^7.1.2",
71
- "eslint": "^9.39.2",
72
- "eslint-config-sukka": "^8.1.0",
73
- "eslint-formatter-sukka": "^8.1.0",
69
+ "bumpp": "^10.4.1",
70
+ "css-loader": "^7.1.4",
71
+ "earl": "^2.0.0",
72
+ "eslint": "^9.39.3",
73
+ "eslint-config-sukka": "^8.7.0",
74
+ "eslint-formatter-sukka": "^8.7.0",
74
75
  "expect": "^30.2.0",
75
- "memfs": "^4.51.1",
76
- "mini-css-extract-plugin": "^2.9.4",
76
+ "memfs": "^4.56.10",
77
+ "mini-css-extract-plugin": "^2.10.0",
77
78
  "mocha": "^11.7.5",
78
- "mocha-expect-snapshot": "^8.0.0",
79
- "next": "^15.5.9",
79
+ "next": "^15.5.12",
80
80
  "postcss": "^8.5.6",
81
81
  "premove": "^4.0.0",
82
- "rollup": "^4.55.1",
82
+ "rollup": "^4.59.0",
83
83
  "rollup-plugin-copy": "^3.5.0",
84
84
  "rollup-plugin-dts": "^6.3.0",
85
85
  "rollup-plugin-swc3": "^0.12.1",
86
- "swc-loader": "^0.2.6",
86
+ "swc-loader": "^0.2.7",
87
87
  "typescript": "^5.9.3",
88
- "webpack": "^5.104.1"
88
+ "webpack": "^5.105.3"
89
89
  },
90
90
  "peerDependencies": {
91
91
  "@stylexjs/babel-plugin": "*"
92
92
  },
93
- "packageManager": "pnpm@10.27.0",
93
+ "packageManager": "pnpm@10.30.3",
94
94
  "pnpm": {
95
95
  "overrides": {
96
96
  "eslint>chalk": "npm:picocolors@^1.1.1"