stylex-webpack 0.1.1-beta.1 → 0.1.1-beta.2
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/next.d.ts +2 -2
- package/dist/next.js +4 -2
- package/next.d.ts +1 -0
- package/next.js +5 -0
- package/package.json +5 -2
package/dist/next.d.ts
CHANGED
|
@@ -27,6 +27,6 @@ interface StyleXPluginOption {
|
|
|
27
27
|
rootDir?: string;
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
declare const
|
|
30
|
+
declare const withStyleX: (pluginOptions?: StyleXPluginOption) => (nextConfig?: NextConfig) => NextConfig;
|
|
31
31
|
|
|
32
|
-
export {
|
|
32
|
+
export { withStyleX };
|
package/dist/next.js
CHANGED
|
@@ -47,7 +47,7 @@ function getStyleXVirtualCssLoader(options, MiniCssExtractPlugin) {
|
|
|
47
47
|
}
|
|
48
48
|
return loaders;
|
|
49
49
|
}
|
|
50
|
-
|
|
50
|
+
const withStyleX = (pluginOptions)=>(nextConfig = {})=>{
|
|
51
51
|
return {
|
|
52
52
|
...nextConfig,
|
|
53
53
|
webpack (config, ctx) {
|
|
@@ -62,7 +62,7 @@ module.exports = (pluginOptions)=>(nextConfig = {})=>{
|
|
|
62
62
|
const MiniCssExtractPlugin = getNextMiniCssExtractPlugin(ctx.dev);
|
|
63
63
|
// Based on https://github.com/vercel/next.js/blob/88a5f263f11cb55907f0d89a4cd53647ee8e96ac/packages/next/build/webpack/config/helpers.ts#L12-L18
|
|
64
64
|
const cssRules = config.module.rules.find((rule)=>Array.isArray(rule.oneOf) && rule.oneOf.some(({ test })=>typeof test === 'object' && typeof test.test === 'function' && test.test('filename.css'))).oneOf;
|
|
65
|
-
// Here we matches virtual css file emitted by
|
|
65
|
+
// Here we matches virtual css file emitted by StyleXPlugin
|
|
66
66
|
cssRules.unshift({
|
|
67
67
|
test: VIRTUAL_CSS_PATTERN,
|
|
68
68
|
use: getStyleXVirtualCssLoader(ctx, MiniCssExtractPlugin)
|
|
@@ -113,3 +113,5 @@ module.exports = (pluginOptions)=>(nextConfig = {})=>{
|
|
|
113
113
|
}
|
|
114
114
|
};
|
|
115
115
|
};
|
|
116
|
+
|
|
117
|
+
exports.withStyleX = withStyleX;
|
package/next.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './dist/next';
|
package/next.js
ADDED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "stylex-webpack",
|
|
3
|
-
"version": "0.1.1-beta.
|
|
3
|
+
"version": "0.1.1-beta.2",
|
|
4
4
|
"description": "The another Webpack Plugin for Facebook's StyleX",
|
|
5
5
|
"homepage": "https://github.com/SukkaW/style9-webpack#readme",
|
|
6
6
|
"repository": {
|
|
@@ -14,14 +14,16 @@
|
|
|
14
14
|
"types": "dist/index.d.ts",
|
|
15
15
|
"files": [
|
|
16
16
|
"dist",
|
|
17
|
+
"next.d.ts",
|
|
17
18
|
"next.js"
|
|
18
19
|
],
|
|
19
20
|
"scripts": {
|
|
21
|
+
"prebuild": "rimraf dist",
|
|
20
22
|
"build": "rollup -c rollup.config.ts --configPlugin swc3 --bundleConfigAsCjs",
|
|
21
|
-
"prerelease": "npm run build",
|
|
22
23
|
"lint": "eslint --format=sukka .",
|
|
23
24
|
"test": "mocha --require @swc-node/register test/index.ts",
|
|
24
25
|
"test:update": "mocha --update --require @swc-node/register test/index.ts",
|
|
26
|
+
"prerelease": "npm run build && npm run lint",
|
|
25
27
|
"release": "bumpp -r --all --commit=\"release: %s\" --tag=\"%s\""
|
|
26
28
|
},
|
|
27
29
|
"keywords": [
|
|
@@ -63,6 +65,7 @@
|
|
|
63
65
|
"mocha": "^10.3.0",
|
|
64
66
|
"mocha-chai-jest-snapshot": "^1.1.4",
|
|
65
67
|
"next": "^14.1.0",
|
|
68
|
+
"rimraf": "^5.0.5",
|
|
66
69
|
"rollup": "^4.10.0",
|
|
67
70
|
"rollup-plugin-copy": "^3.5.0",
|
|
68
71
|
"rollup-plugin-dts": "^6.1.0",
|