@stylexswc/webpack-plugin 0.17.2-dev.1 → 0.18.0-rc.1
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/README.md +21 -10
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -3
- package/package.json +4 -9
- package/dist/shared.d.ts +0 -7
- package/dist/shared.d.ts.map +0 -1
- package/dist/shared.js +0 -10
package/README.md
CHANGED
|
@@ -76,14 +76,25 @@ the build. Like a regular CSS file, it must flow through your CSS pipeline, so a
|
|
|
76
76
|
`css-loader` + `MiniCssExtractPlugin.loader` rule (or webpack's built-in CSS
|
|
77
77
|
support) has to cover `.css` files.
|
|
78
78
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
79
|
+
The carrier import is a **recommendation, not a hard requirement**. The plugin
|
|
80
|
+
also appends tiny per-module CSS imports to every StyleX module, so any part of
|
|
81
|
+
the bundle that renders a StyleX component pulls the stylesheet in on its own —
|
|
82
|
+
most builds emit correct CSS even without the carrier. What the carrier adds is
|
|
83
|
+
a guarantee that doesn't depend on your module graph: the stylesheet is always
|
|
84
|
+
present and loaded with the entrypoint. That matters when something consumes
|
|
85
|
+
StyleX **output** without rendering a StyleX **component** — plain CSS reading
|
|
86
|
+
`defineVars` custom properties (`var(--x…)`), or injected markup carrying
|
|
87
|
+
StyleX class names. If styles would actually be lost (no CSS asset exists to
|
|
88
|
+
receive them at all), the plugin raises a compilation warning; it stays silent
|
|
89
|
+
as long as the output is correct, carrier or not.
|
|
90
|
+
|
|
91
|
+
> [!IMPORTANT] **Migrating from 0.17.x**: version 0.18.0 reworks the CSS
|
|
92
|
+
> extraction architecture. The CSS is no longer injected through
|
|
93
|
+
> auto-generated `stylex.virtual.css` imports — add the
|
|
83
94
|
> `import '@stylexswc/webpack-plugin/stylex.css';` carrier import to your app
|
|
84
|
-
> entrypoint
|
|
85
|
-
> identifiers are now relative to `compiler.context`, which changes
|
|
86
|
-
> once and makes builds reproducible across machines.
|
|
95
|
+
> entrypoint (recommended; see above for when you can skip it). Paths embedded
|
|
96
|
+
> in module identifiers are now relative to `compiler.context`, which changes
|
|
97
|
+
> chunk hashes once and makes builds reproducible across machines.
|
|
87
98
|
|
|
88
99
|
## Plugin Options
|
|
89
100
|
|
|
@@ -216,9 +227,9 @@ new StylexPlugin({
|
|
|
216
227
|
import './styles/stylex-carrier.css';
|
|
217
228
|
```
|
|
218
229
|
|
|
219
|
-
If styles get extracted but no
|
|
220
|
-
|
|
221
|
-
silently dropping the CSS.
|
|
230
|
+
If styles get extracted but no CSS asset is emitted to receive them (e.g. a
|
|
231
|
+
custom `cacheGroup` renamed the chunk), the plugin raises a compilation
|
|
232
|
+
warning instead of silently dropping the CSS.
|
|
222
233
|
|
|
223
234
|
### Advanced Options
|
|
224
235
|
|
package/dist/index.d.ts
CHANGED
|
@@ -5,7 +5,6 @@ export default class StyleXPlugin extends StyleXPluginCore {
|
|
|
5
5
|
apply(compiler: webpack.Compiler): void;
|
|
6
6
|
}
|
|
7
7
|
export { StyleXPlugin, VIRTUAL_CSS_PATTERN, DEFAULT_STYLEX_PACKAGES, buildVirtualCssPattern };
|
|
8
|
-
export { isAllowlistedPackage } from '@stylexswc/plugin-shared';
|
|
9
8
|
export { stylexLoaderPath as loader, stylexVirtualCssLoaderPath as virtualLoader };
|
|
10
9
|
export type { CacheGroupOptions, RegisterStyleXRules, StyleXPluginOption, } from '@stylexswc/plugin-shared';
|
|
11
10
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,uBAAuB,EAGvB,gBAAgB,EAChB,mBAAmB,EAEnB,sBAAsB,EACtB,gBAAgB,EAChB,0BAA0B,EAC3B,MAAM,0BAA0B,CAAC;AAElC,OAAO,KAAK,OAAO,MAAM,SAAS,CAAC;AAEnC,eAAO,MAAM,iBAAiB,8BAA8B,CAAC;AAK7D,MAAM,CAAC,OAAO,OAAO,YAAa,SAAQ,gBAAgB;IACxD,KAAK,CAAC,QAAQ,EAAE,OAAO,CAAC,QAAQ;CA2GjC;AAED,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,uBAAuB,EAAE,sBAAsB,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,uBAAuB,EAGvB,gBAAgB,EAChB,mBAAmB,EAEnB,sBAAsB,EACtB,gBAAgB,EAChB,0BAA0B,EAC3B,MAAM,0BAA0B,CAAC;AAElC,OAAO,KAAK,OAAO,MAAM,SAAS,CAAC;AAEnC,eAAO,MAAM,iBAAiB,8BAA8B,CAAC;AAK7D,MAAM,CAAC,OAAO,OAAO,YAAa,SAAQ,gBAAgB;IACxD,KAAK,CAAC,QAAQ,EAAE,OAAO,CAAC,QAAQ;CA2GjC;AAED,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,uBAAuB,EAAE,sBAAsB,EAAE,CAAC;AAI9F,OAAO,EAAE,gBAAgB,IAAI,MAAM,EAAE,0BAA0B,IAAI,aAAa,EAAE,CAAC;AAEnF,YAAY,EACV,iBAAiB,EACjB,mBAAmB,EACnB,kBAAkB,GACnB,MAAM,0BAA0B,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.virtualLoader = exports.loader = exports.
|
|
6
|
+
exports.virtualLoader = exports.loader = exports.buildVirtualCssPattern = exports.DEFAULT_STYLEX_PACKAGES = exports.VIRTUAL_CSS_PATTERN = exports.StyleXPlugin = exports.STYLEX_CHUNK_NAME = void 0;
|
|
7
7
|
const path_1 = __importDefault(require("path"));
|
|
8
8
|
const plugin_shared_1 = require("@stylexswc/plugin-shared");
|
|
9
9
|
Object.defineProperty(exports, "DEFAULT_STYLEX_PACKAGES", { enumerable: true, get: function () { return plugin_shared_1.DEFAULT_STYLEX_PACKAGES; } });
|
|
@@ -104,8 +104,6 @@ class StyleXPlugin extends plugin_shared_1.StyleXPluginCore {
|
|
|
104
104
|
}
|
|
105
105
|
exports.default = StyleXPlugin;
|
|
106
106
|
exports.StyleXPlugin = StyleXPlugin;
|
|
107
|
-
var plugin_shared_2 = require("@stylexswc/plugin-shared");
|
|
108
|
-
Object.defineProperty(exports, "isAllowlistedPackage", { enumerable: true, get: function () { return plugin_shared_2.isAllowlistedPackage; } });
|
|
109
107
|
// Skipped when `module.exports` is an ES module namespace (frozen, cannot be
|
|
110
108
|
// reassigned) — the ESM exports above provide the same surface there
|
|
111
109
|
if (typeof module !== 'undefined' &&
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stylexswc/webpack-plugin",
|
|
3
3
|
"description": "StyleX plugin for webpack powered by a Rust NAPI-RS/SWC compiler. Fast StyleX transforms and CSS extraction without Babel.",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.18.0-rc.1",
|
|
5
5
|
"bugs": "https://github.com/Dwlad90/stylex-swc-plugin/issues",
|
|
6
6
|
"config": {
|
|
7
7
|
"scripty": {
|
|
@@ -9,13 +9,13 @@
|
|
|
9
9
|
}
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@stylexswc/plugin-shared": "0.
|
|
12
|
+
"@stylexswc/plugin-shared": "0.18.0-rc.1"
|
|
13
13
|
},
|
|
14
14
|
"devDependencies": {
|
|
15
15
|
"@stylexjs/babel-plugin": "^0.19.0",
|
|
16
16
|
"@stylexjs/stylex": "^0.19.0",
|
|
17
|
-
"@stylexswc/eslint-config": "0.
|
|
18
|
-
"@stylexswc/typescript-config": "0.
|
|
17
|
+
"@stylexswc/eslint-config": "0.18.0-rc.1",
|
|
18
|
+
"@stylexswc/typescript-config": "0.18.0-rc.1",
|
|
19
19
|
"@types/node": "^26.1.0",
|
|
20
20
|
"css-loader": "^7.1.2",
|
|
21
21
|
"memfs": "^4.17.0",
|
|
@@ -29,11 +29,6 @@
|
|
|
29
29
|
"import": "./dist/index.js",
|
|
30
30
|
"require": "./dist/index.js"
|
|
31
31
|
},
|
|
32
|
-
"./shared": {
|
|
33
|
-
"types": "./dist/shared.d.ts",
|
|
34
|
-
"import": "./dist/shared.js",
|
|
35
|
-
"require": "./dist/shared.js"
|
|
36
|
-
},
|
|
37
32
|
"./stylex.css": "./dist/stylex.css",
|
|
38
33
|
"./package.json": "./package.json"
|
|
39
34
|
},
|
package/dist/shared.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @deprecated Import from `@stylexswc/plugin-shared` instead. This subpath
|
|
3
|
-
* re-export is kept for backwards compatibility and will be removed in a
|
|
4
|
-
* future release.
|
|
5
|
-
*/
|
|
6
|
-
export { isAllowlistedPackage } from '@stylexswc/plugin-shared';
|
|
7
|
-
//# sourceMappingURL=shared.d.ts.map
|
package/dist/shared.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../src/shared.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC"}
|
package/dist/shared.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isAllowlistedPackage = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* @deprecated Import from `@stylexswc/plugin-shared` instead. This subpath
|
|
6
|
-
* re-export is kept for backwards compatibility and will be removed in a
|
|
7
|
-
* future release.
|
|
8
|
-
*/
|
|
9
|
-
var plugin_shared_1 = require("@stylexswc/plugin-shared");
|
|
10
|
-
Object.defineProperty(exports, "isAllowlistedPackage", { enumerable: true, get: function () { return plugin_shared_1.isAllowlistedPackage; } });
|