@stylexswc/webpack-plugin 0.17.0-rc.2 → 0.17.0-rc.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/README.md +21 -16
- package/dist/constants.d.ts +5 -0
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +6 -1
- package/dist/index.d.ts +14 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +58 -13
- package/dist/shared.d.ts +2 -0
- package/dist/shared.d.ts.map +1 -0
- package/dist/shared.js +15 -0
- package/dist/types.d.ts +11 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +29 -15
package/README.md
CHANGED
|
@@ -144,6 +144,22 @@ module.exports = config;
|
|
|
144
144
|
|
|
145
145
|
With `loaderOrder: 'first'`, the plugin automatically preserves these imports by injecting side-effect imports.
|
|
146
146
|
|
|
147
|
+
#### `stylexPackages`
|
|
148
|
+
|
|
149
|
+
- Type: `string[]`
|
|
150
|
+
- Optional
|
|
151
|
+
- Default: `['@stylexjs/']`
|
|
152
|
+
- Description: `node_modules` is **excluded by default**, even for files that
|
|
153
|
+
reference a StyleX import. Packages that ship untransformed StyleX source
|
|
154
|
+
(e.g. component libraries) must be allowlisted here with path fragments so
|
|
155
|
+
the StyleX loader still processes them:
|
|
156
|
+
|
|
157
|
+
```javascript
|
|
158
|
+
new StylexPlugin({
|
|
159
|
+
stylexPackages: ['@stylexjs/', 'my-design-system'],
|
|
160
|
+
});
|
|
161
|
+
```
|
|
162
|
+
|
|
147
163
|
### Advanced Options
|
|
148
164
|
|
|
149
165
|
#### `transformCss`
|
|
@@ -263,29 +279,18 @@ new StylexPlugin({
|
|
|
263
279
|
})
|
|
264
280
|
```
|
|
265
281
|
|
|
266
|
-
**Exclude node_modules except specific packages:**
|
|
267
|
-
|
|
268
|
-
```javascript
|
|
269
|
-
new StylexPlugin({
|
|
270
|
-
rsOptions: {
|
|
271
|
-
// Exclude all node_modules except @stylexjs/open-props
|
|
272
|
-
exclude: [/node_modules(?!\/@stylexjs\/open-props)/],
|
|
273
|
-
},
|
|
274
|
-
})
|
|
275
|
-
```
|
|
276
|
-
|
|
277
282
|
**Transform only specific packages from node_modules:**
|
|
278
283
|
|
|
284
|
+
`node_modules` is excluded by default regardless of `rsOptions.include`/
|
|
285
|
+
`exclude` — allowlist packages with `stylexPackages` instead:
|
|
286
|
+
|
|
279
287
|
```javascript
|
|
280
288
|
new StylexPlugin({
|
|
281
289
|
rsOptions: {
|
|
282
|
-
include: [
|
|
283
|
-
'src/**/*.{ts,tsx}',
|
|
284
|
-
'node_modules/@stylexjs/open-props/**/*.js',
|
|
285
|
-
'node_modules/@my-org/design-system/**/*.js',
|
|
286
|
-
],
|
|
290
|
+
include: ['src/**/*.{ts,tsx}'],
|
|
287
291
|
exclude: ['**/*.test.*'],
|
|
288
292
|
},
|
|
293
|
+
stylexPackages: ['@stylexjs/open-props', '@my-org/design-system'],
|
|
289
294
|
})
|
|
290
295
|
```
|
|
291
296
|
|
package/dist/constants.d.ts
CHANGED
|
@@ -4,4 +4,9 @@ export declare const VIRTUAL_CSS_PATTERN: RegExp;
|
|
|
4
4
|
export declare const STYLEX_CHUNK_NAME = "_stylex-webpack-generated";
|
|
5
5
|
export declare const INCLUDE_REGEXP: RegExp;
|
|
6
6
|
export declare const IS_DEV_ENV: boolean;
|
|
7
|
+
/**
|
|
8
|
+
* node_modules packages that ship untransformed StyleX source and must go
|
|
9
|
+
* through the stylex-loader even though node_modules is excluded by default
|
|
10
|
+
*/
|
|
11
|
+
export declare const DEFAULT_STYLEX_PACKAGES: string[];
|
|
7
12
|
//# sourceMappingURL=constants.d.ts.map
|
package/dist/constants.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,WAAW,WAAW,CAAC;AACpC,eAAO,MAAM,gBAAgB,QAA0C,CAAC;AACxE,eAAO,MAAM,mBAAmB,QAAyB,CAAC;AAC1D,eAAO,MAAM,iBAAiB,8BAA8B,CAAC;AAC7D,eAAO,MAAM,cAAc,QAAoB,CAAC;AAChD,eAAO,MAAM,UAAU,SAAyC,CAAC"}
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,WAAW,WAAW,CAAC;AACpC,eAAO,MAAM,gBAAgB,QAA0C,CAAC;AACxE,eAAO,MAAM,mBAAmB,QAAyB,CAAC;AAC1D,eAAO,MAAM,iBAAiB,8BAA8B,CAAC;AAC7D,eAAO,MAAM,cAAc,QAAoB,CAAC;AAChD,eAAO,MAAM,UAAU,SAAyC,CAAC;AACjE;;;GAGG;AACH,eAAO,MAAM,uBAAuB,UAAiB,CAAC"}
|
package/dist/constants.js
CHANGED
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.IS_DEV_ENV = exports.INCLUDE_REGEXP = exports.STYLEX_CHUNK_NAME = exports.VIRTUAL_CSS_PATTERN = exports.VIRTUAL_CSS_PATH = exports.PLUGIN_NAME = void 0;
|
|
3
|
+
exports.DEFAULT_STYLEX_PACKAGES = exports.IS_DEV_ENV = exports.INCLUDE_REGEXP = exports.STYLEX_CHUNK_NAME = exports.VIRTUAL_CSS_PATTERN = exports.VIRTUAL_CSS_PATH = exports.PLUGIN_NAME = void 0;
|
|
4
4
|
exports.PLUGIN_NAME = 'stylex';
|
|
5
5
|
exports.VIRTUAL_CSS_PATH = require.resolve('./stylex.virtual.css');
|
|
6
6
|
exports.VIRTUAL_CSS_PATTERN = /stylex\.virtual\.css/;
|
|
7
7
|
exports.STYLEX_CHUNK_NAME = '_stylex-webpack-generated';
|
|
8
8
|
exports.INCLUDE_REGEXP = /\.[cm]?[jt]sx?$/;
|
|
9
9
|
exports.IS_DEV_ENV = process.env.NODE_ENV === 'development';
|
|
10
|
+
/**
|
|
11
|
+
* node_modules packages that ship untransformed StyleX source and must go
|
|
12
|
+
* through the stylex-loader even though node_modules is excluded by default
|
|
13
|
+
*/
|
|
14
|
+
exports.DEFAULT_STYLEX_PACKAGES = ['@stylexjs/'];
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import { STYLEX_CHUNK_NAME, VIRTUAL_CSS_PATTERN } from './constants';
|
|
1
|
+
import { DEFAULT_STYLEX_PACKAGES, STYLEX_CHUNK_NAME, VIRTUAL_CSS_PATTERN } from './constants';
|
|
2
2
|
import type { TransformedOptions } from '@stylexswc/rs-compiler';
|
|
3
3
|
import type webpack from 'webpack';
|
|
4
4
|
import type { Rule as StyleXRule } from '@stylexjs/babel-plugin';
|
|
5
5
|
import type { CSSTransformer, StyleXPluginOption, StyleXWebpackLoaderOptions, CacheGroupOptions } from './types';
|
|
6
|
+
declare const stylexLoaderPath: string;
|
|
7
|
+
declare const stylexVirtualLoaderPath: string;
|
|
6
8
|
export type RegisterStyleXRules = (_resourcePath: string, _stylexRules: StyleXRule[]) => void;
|
|
7
9
|
export default class StyleXPlugin {
|
|
8
10
|
stylexRules: Map<string, readonly StyleXRule[]>;
|
|
@@ -11,9 +13,18 @@ export default class StyleXPlugin {
|
|
|
11
13
|
cacheGroup?: CacheGroupOptions;
|
|
12
14
|
transformCss: CSSTransformer;
|
|
13
15
|
loaderOrder: StyleXPluginOption['loaderOrder'];
|
|
14
|
-
|
|
16
|
+
stylexPackages: string[];
|
|
17
|
+
constructor({ stylexImports, useCSSLayers, rsOptions, nextjsMode, transformCss, extractCSS, loaderOrder, cacheGroup, stylexPackages, }?: StyleXPluginOption);
|
|
18
|
+
/**
|
|
19
|
+
* Excludes node_modules by default, matching the rspack plugin, so
|
|
20
|
+
* unrelated dependencies whose source happens to mention a StyleX import
|
|
21
|
+
* string aren't parsed and transformed unless explicitly allowlisted.
|
|
22
|
+
*/
|
|
23
|
+
shouldProcessFile(resourcePath: string): boolean;
|
|
15
24
|
apply(compiler: webpack.Compiler): void;
|
|
16
25
|
}
|
|
17
|
-
export { VIRTUAL_CSS_PATTERN, STYLEX_CHUNK_NAME };
|
|
26
|
+
export { VIRTUAL_CSS_PATTERN, STYLEX_CHUNK_NAME, DEFAULT_STYLEX_PACKAGES };
|
|
27
|
+
export { isAllowlistedPackage } from './shared';
|
|
28
|
+
export { stylexLoaderPath as loader, stylexVirtualLoaderPath as virtualLoader };
|
|
18
29
|
export type { StyleXPluginOption, CacheGroupOptions } from './types';
|
|
19
30
|
//# 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,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,uBAAuB,EAIvB,iBAAiB,EAEjB,mBAAmB,EACpB,MAAM,aAAa,CAAC;AAIrB,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAEjE,OAAO,KAAK,OAAO,MAAM,SAAS,CAAC;AACnC,OAAO,KAAK,EAAE,IAAI,IAAI,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACjE,OAAO,KAAK,EACV,cAAc,EACd,kBAAkB,EAClB,0BAA0B,EAE1B,iBAAiB,EAClB,MAAM,SAAS,CAAC;AAoBjB,QAAA,MAAM,gBAAgB,QAAqC,CAAC;AAC5D,QAAA,MAAM,uBAAuB,QAAiD,CAAC;AAiB/E,MAAM,MAAM,mBAAmB,GAAG,CAAC,aAAa,EAAE,MAAM,EAAE,YAAY,EAAE,UAAU,EAAE,KAAK,IAAI,CAAC;AAE9F,MAAM,CAAC,OAAO,OAAO,YAAY;IAC/B,WAAW,qCAA4C;IACvD,kBAAkB,EAAE,kBAAkB,CAAC;IAEvC,YAAY,EAAE,0BAA0B,CAAC;IACzC,UAAU,CAAC,EAAE,iBAAiB,CAAC;IAC/B,YAAY,EAAE,cAAc,CAAC;IAC7B,WAAW,EAAE,kBAAkB,CAAC,aAAa,CAAC,CAAC;IAC/C,cAAc,EAAE,MAAM,EAAE,CAAC;gBACb,EACV,aAA8C,EAC9C,YAAoB,EACpB,SAAc,EACd,UAAkB,EAClB,YAAgC,EAChC,UAAiB,EACjB,WAAqB,EACrB,UAAU,EACV,cAAwC,GACzC,GAAE,kBAAuB;IA0B1B;;;;OAIG;IACH,iBAAiB,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO;IAoBhD,KAAK,CAAC,QAAQ,EAAE,OAAO,CAAC,QAAQ;CAmKjC;AAED,OAAO,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,uBAAuB,EAAE,CAAC;AAC3E,OAAO,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAGhD,OAAO,EAAE,gBAAgB,IAAI,MAAM,EAAE,uBAAuB,IAAI,aAAa,EAAE,CAAC;AAEhF,YAAY,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -3,15 +3,33 @@ 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.STYLEX_CHUNK_NAME = exports.VIRTUAL_CSS_PATTERN = void 0;
|
|
6
|
+
exports.virtualLoader = exports.loader = exports.isAllowlistedPackage = exports.DEFAULT_STYLEX_PACKAGES = exports.STYLEX_CHUNK_NAME = exports.VIRTUAL_CSS_PATTERN = void 0;
|
|
7
7
|
const babel_plugin_1 = __importDefault(require("@stylexjs/babel-plugin"));
|
|
8
8
|
const path_1 = __importDefault(require("path"));
|
|
9
9
|
const constants_1 = require("./constants");
|
|
10
|
+
Object.defineProperty(exports, "DEFAULT_STYLEX_PACKAGES", { enumerable: true, get: function () { return constants_1.DEFAULT_STYLEX_PACKAGES; } });
|
|
10
11
|
Object.defineProperty(exports, "STYLEX_CHUNK_NAME", { enumerable: true, get: function () { return constants_1.STYLEX_CHUNK_NAME; } });
|
|
11
12
|
Object.defineProperty(exports, "VIRTUAL_CSS_PATTERN", { enumerable: true, get: function () { return constants_1.VIRTUAL_CSS_PATTERN; } });
|
|
12
13
|
const rs_compiler_1 = require("@stylexswc/rs-compiler");
|
|
13
|
-
const
|
|
14
|
-
|
|
14
|
+
const shared_1 = require("./shared");
|
|
15
|
+
function resolveLoaderPath(loaderName) {
|
|
16
|
+
try {
|
|
17
|
+
return require.resolve(`./${loaderName}`);
|
|
18
|
+
}
|
|
19
|
+
catch (error) {
|
|
20
|
+
const isModuleNotFound = error instanceof Error && 'code' in error && error.code === 'MODULE_NOT_FOUND';
|
|
21
|
+
if (!isModuleNotFound) {
|
|
22
|
+
throw error;
|
|
23
|
+
}
|
|
24
|
+
// Loaders resolve as `.ts` only when the plugin runs from source (e.g. vitest);
|
|
25
|
+
// published dist builds always resolve above
|
|
26
|
+
return require.resolve(`./${loaderName}.ts`);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
const stylexLoaderPath = resolveLoaderPath('stylex-loader');
|
|
30
|
+
exports.loader = stylexLoaderPath;
|
|
31
|
+
const stylexVirtualLoaderPath = resolveLoaderPath('stylex-virtual-css-loader');
|
|
32
|
+
exports.virtualLoader = stylexVirtualLoaderPath;
|
|
15
33
|
const getStyleXRules = (stylexRules, transformedOptions) => {
|
|
16
34
|
if (stylexRules.size === 0) {
|
|
17
35
|
return null;
|
|
@@ -20,7 +38,7 @@ const getStyleXRules = (stylexRules, transformedOptions) => {
|
|
|
20
38
|
const allRules = Array.from(stylexRules.values()).flat();
|
|
21
39
|
return babel_plugin_1.default.processStylexRules(allRules, transformedOptions);
|
|
22
40
|
};
|
|
23
|
-
const
|
|
41
|
+
const identityTransform = css => css;
|
|
24
42
|
class StyleXPlugin {
|
|
25
43
|
stylexRules = new Map();
|
|
26
44
|
transformedOptions;
|
|
@@ -28,7 +46,8 @@ class StyleXPlugin {
|
|
|
28
46
|
cacheGroup;
|
|
29
47
|
transformCss;
|
|
30
48
|
loaderOrder;
|
|
31
|
-
|
|
49
|
+
stylexPackages;
|
|
50
|
+
constructor({ stylexImports = ['stylex', '@stylexjs/stylex'], useCSSLayers = false, rsOptions = {}, nextjsMode = false, transformCss = identityTransform, extractCSS = true, loaderOrder = 'first', cacheGroup, stylexPackages = constants_1.DEFAULT_STYLEX_PACKAGES, } = {}) {
|
|
32
51
|
this.transformedOptions = {
|
|
33
52
|
useLayers: useCSSLayers,
|
|
34
53
|
legacyDisableLayers: rsOptions.legacyDisableLayers,
|
|
@@ -51,6 +70,24 @@ class StyleXPlugin {
|
|
|
51
70
|
this.transformCss = transformCss;
|
|
52
71
|
this.loaderOrder = loaderOrder;
|
|
53
72
|
this.cacheGroup = cacheGroup;
|
|
73
|
+
this.stylexPackages = stylexPackages;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Excludes node_modules by default, matching the rspack plugin, so
|
|
77
|
+
* unrelated dependencies whose source happens to mention a StyleX import
|
|
78
|
+
* string aren't parsed and transformed unless explicitly allowlisted.
|
|
79
|
+
*/
|
|
80
|
+
shouldProcessFile(resourcePath) {
|
|
81
|
+
if (!resourcePath) {
|
|
82
|
+
return false;
|
|
83
|
+
}
|
|
84
|
+
const nodeModulesSegment = `${path_1.default.sep}node_modules${path_1.default.sep}`;
|
|
85
|
+
if (resourcePath.includes(nodeModulesSegment)) {
|
|
86
|
+
if (!(0, shared_1.isAllowlistedPackage)(resourcePath, this.stylexPackages)) {
|
|
87
|
+
return false;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
return (0, rs_compiler_1.shouldTransformFile)(resourcePath, this.loaderOption.rsOptions?.include, this.loaderOption.rsOptions?.exclude);
|
|
54
91
|
}
|
|
55
92
|
apply(compiler) {
|
|
56
93
|
// If splitChunk is enabled, we create a dedicated chunk for stylex css
|
|
@@ -87,8 +124,8 @@ class StyleXPlugin {
|
|
|
87
124
|
NormalModule.getCompilationHooks(compilation).loader.tap(constants_1.PLUGIN_NAME, (loaderContext, mod) => {
|
|
88
125
|
const extname = path_1.default.extname(mod.matchResource || mod.resource);
|
|
89
126
|
if (constants_1.INCLUDE_REGEXP.test(extname)) {
|
|
90
|
-
// Add path filtering check
|
|
91
|
-
const shouldTransform =
|
|
127
|
+
// Add path filtering check, including the node_modules allowlist
|
|
128
|
+
const shouldTransform = this.shouldProcessFile(mod.resource);
|
|
92
129
|
if (!shouldTransform) {
|
|
93
130
|
return; // Skip adding loader if filtered out
|
|
94
131
|
}
|
|
@@ -175,9 +212,17 @@ class StyleXPlugin {
|
|
|
175
212
|
}
|
|
176
213
|
}
|
|
177
214
|
exports.default = StyleXPlugin;
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
module.exports
|
|
181
|
-
|
|
182
|
-
module
|
|
183
|
-
module.exports
|
|
215
|
+
var shared_2 = require("./shared");
|
|
216
|
+
Object.defineProperty(exports, "isAllowlistedPackage", { enumerable: true, get: function () { return shared_2.isAllowlistedPackage; } });
|
|
217
|
+
// Skipped when `module.exports` is an ES module namespace (frozen, cannot be
|
|
218
|
+
// reassigned) — the ESM exports above provide the same surface there
|
|
219
|
+
if (typeof module !== 'undefined' &&
|
|
220
|
+
Object.prototype.toString.call(module.exports) !== '[object Module]') {
|
|
221
|
+
module.exports = StyleXPlugin;
|
|
222
|
+
module.exports.default = StyleXPlugin;
|
|
223
|
+
module.exports.loader = stylexLoaderPath;
|
|
224
|
+
module.exports.virtualLoader = stylexVirtualLoaderPath;
|
|
225
|
+
module.exports.VIRTUAL_CSS_PATTERN = constants_1.VIRTUAL_CSS_PATTERN;
|
|
226
|
+
module.exports.STYLEX_CHUNK_NAME = constants_1.STYLEX_CHUNK_NAME;
|
|
227
|
+
module.exports.DEFAULT_STYLEX_PACKAGES = constants_1.DEFAULT_STYLEX_PACKAGES;
|
|
228
|
+
}
|
package/dist/shared.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../src/shared.ts"],"names":[],"mappings":"AAEA,wBAAgB,oBAAoB,CAAC,YAAY,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,WAYlF"}
|
package/dist/shared.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.isAllowlistedPackage = isAllowlistedPackage;
|
|
7
|
+
const path_1 = __importDefault(require("path"));
|
|
8
|
+
function isAllowlistedPackage(resourcePath, stylexPackages) {
|
|
9
|
+
const nodeModulesSegment = `${path_1.default.sep}node_modules${path_1.default.sep}`;
|
|
10
|
+
const nodeModulesEntries = path_1.default.normalize(resourcePath).split(nodeModulesSegment).slice(1);
|
|
11
|
+
return stylexPackages.some(packageName => {
|
|
12
|
+
const normalizedPackageName = path_1.default.normalize(packageName).replace(/[\\/]$/, '');
|
|
13
|
+
return nodeModulesEntries.some(entry => entry === normalizedPackageName || entry.startsWith(`${normalizedPackageName}${path_1.default.sep}`));
|
|
14
|
+
});
|
|
15
|
+
}
|
package/dist/types.d.ts
CHANGED
|
@@ -65,6 +65,17 @@ export interface StyleXPluginOption {
|
|
|
65
65
|
* @see https://webpack.js.org/plugins/split-chunks-plugin/#splitchunkscachegroups
|
|
66
66
|
*/
|
|
67
67
|
cacheGroup?: CacheGroupOptions;
|
|
68
|
+
/**
|
|
69
|
+
* node_modules packages that must be processed by the stylex-loader.
|
|
70
|
+
*
|
|
71
|
+
* By default, node_modules is excluded even if a module imports StyleX, so
|
|
72
|
+
* only source that ships already-untransformed StyleX (e.g. component
|
|
73
|
+
* libraries) needs to opt in here. List path fragments (e.g. '@stylexjs/',
|
|
74
|
+
* 'my-design-system') for packages that ship untransformed StyleX source.
|
|
75
|
+
*
|
|
76
|
+
* @default ['@stylexjs/']
|
|
77
|
+
*/
|
|
78
|
+
stylexPackages?: string[];
|
|
68
79
|
}
|
|
69
80
|
export type StyleXWebpackLoaderOptions = {
|
|
70
81
|
stylexImports: StyleXOptions['importSources'];
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAC3E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC7C,OAAO,KAAK,OAAO,MAAM,SAAS,CAAC;AACnC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,GAAG,CAAC;AAE7C,MAAM,MAAM,iBAAiB,GAAG,WAAW,CACzC,OAAO,CACL,OAAO,CAAC,OAAO,CAAC,aAAa,CAAC,cAAc,CAAC,EAAE,SAAS,CAAC,CAAC,aAAa,CAAC,EACxE,SAAS,GAAG,KAAK,CAClB,CAAC,aAAa,CAAC,CACjB,CAAC,MAAM,CAAC,CAAC;AAEV,KAAK,aAAa,GAAG,UAAU,CAAC,UAAU,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;AAE7E,MAAM,MAAM,SAAS,GAAG,aAAa,CAAC,GAAG,CAAC,CAAC;AAC3C,MAAM,MAAM,SAAS,GAAG,aAAa,CAAC,GAAG,CAAC,CAAC;AAE3C,MAAM,MAAM,cAAc,GAAG,CAC3B,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,MAAM,GAAG,SAAS,KAC1B,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,MAAM,CAAC,CAAC;AAEhD,MAAM,WAAW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AAG,CAAC,EAAE,IAAI,GAAG,MAAM,CAAA;KAAE,CAAC;IAC5C,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,17 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stylexswc/webpack-plugin",
|
|
3
3
|
"description": "StyleX webpack plugin with NAPI-RS compiler",
|
|
4
|
-
"version": "0.17.0-rc.
|
|
5
|
-
"private": false,
|
|
6
|
-
"license": "MIT",
|
|
7
|
-
"sideEffects": false,
|
|
8
|
-
"files": [
|
|
9
|
-
"dist"
|
|
10
|
-
],
|
|
11
|
-
"publishConfig": {
|
|
12
|
-
"registry": "https://registry.npmjs.org/",
|
|
13
|
-
"access": "public"
|
|
14
|
-
},
|
|
4
|
+
"version": "0.17.0-rc.4",
|
|
15
5
|
"config": {
|
|
16
6
|
"scripty": {
|
|
17
7
|
"path": "../../scripts/packages"
|
|
@@ -19,25 +9,49 @@
|
|
|
19
9
|
},
|
|
20
10
|
"dependencies": {
|
|
21
11
|
"@stylexjs/babel-plugin": "^0.19.0",
|
|
22
|
-
"@stylexswc/rs-compiler": "0.17.0-rc.
|
|
12
|
+
"@stylexswc/rs-compiler": "0.17.0-rc.4",
|
|
23
13
|
"loader-utils": "^3.3.1"
|
|
24
14
|
},
|
|
25
15
|
"devDependencies": {
|
|
26
|
-
"@stylexswc/eslint-config": "0.17.0-rc.
|
|
27
|
-
"@stylexswc/typescript-config": "0.17.0-rc.
|
|
16
|
+
"@stylexswc/eslint-config": "0.17.0-rc.4",
|
|
17
|
+
"@stylexswc/typescript-config": "0.17.0-rc.4",
|
|
28
18
|
"@types/loader-utils": "^3.0.0",
|
|
29
19
|
"@types/node": "^26.1.0",
|
|
30
20
|
"mini-css-extract-plugin": "^2.10.2",
|
|
21
|
+
"vitest": "^4.1.9",
|
|
31
22
|
"webpack": "^5.108.3"
|
|
32
23
|
},
|
|
24
|
+
"exports": {
|
|
25
|
+
".": {
|
|
26
|
+
"types": "./dist/index.d.ts",
|
|
27
|
+
"import": "./dist/index.js",
|
|
28
|
+
"require": "./dist/index.js"
|
|
29
|
+
},
|
|
30
|
+
"./shared": {
|
|
31
|
+
"types": "./dist/shared.d.ts",
|
|
32
|
+
"import": "./dist/shared.js",
|
|
33
|
+
"require": "./dist/shared.js"
|
|
34
|
+
},
|
|
35
|
+
"./package.json": "./package.json"
|
|
36
|
+
},
|
|
37
|
+
"files": [
|
|
38
|
+
"dist"
|
|
39
|
+
],
|
|
33
40
|
"keywords": [
|
|
34
41
|
"stylex",
|
|
35
42
|
"swc",
|
|
36
43
|
"webpack",
|
|
37
44
|
"webpack-plugin"
|
|
38
45
|
],
|
|
46
|
+
"license": "MIT",
|
|
39
47
|
"main": "dist/index.js",
|
|
48
|
+
"private": false,
|
|
49
|
+
"publishConfig": {
|
|
50
|
+
"registry": "https://registry.npmjs.org/",
|
|
51
|
+
"access": "public"
|
|
52
|
+
},
|
|
40
53
|
"repository": "https://github.com/Dwlad90/stylex-swc-plugin",
|
|
54
|
+
"sideEffects": false,
|
|
41
55
|
"scripts": {
|
|
42
56
|
"build": "scripty --ts",
|
|
43
57
|
"check:artifacts": "scripty",
|
|
@@ -47,7 +61,7 @@
|
|
|
47
61
|
"postbuild": "pnpm run check:artifacts",
|
|
48
62
|
"precommit": "lint-staged",
|
|
49
63
|
"prepush": "lint-prepush",
|
|
50
|
-
"test": "
|
|
64
|
+
"test": "vitest run",
|
|
51
65
|
"typecheck": "scripty --ts"
|
|
52
66
|
}
|
|
53
67
|
}
|