stylex-webpack 0.4.1 → 0.4.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/index.js +8 -11
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -6,7 +6,7 @@ var process = require('node:process');
|
|
|
6
6
|
var VirtualModulesPlugin = require('webpack-virtual-modules');
|
|
7
7
|
var identity = require('foxts/identity');
|
|
8
8
|
|
|
9
|
-
var version = "0.4.
|
|
9
|
+
var version = "0.4.2";
|
|
10
10
|
|
|
11
11
|
const PLUGIN_NAME = 'stylex';
|
|
12
12
|
const VIRTUAL_ENTRYPOINT_CSS_PATH = require.resolve('./stylex.css');
|
|
@@ -150,6 +150,13 @@ class StyleXPlugin {
|
|
|
150
150
|
}
|
|
151
151
|
}
|
|
152
152
|
}
|
|
153
|
+
// Let's find the css file that belongs to the fuck-next.js chunk to remove it
|
|
154
|
+
const fuckNextjsChunkCssAssetNames = Object.keys(assets).filter((assetName)=>fuckNextjsChunk.files.has(assetName) && assetName.endsWith('.css'));
|
|
155
|
+
if (fuckNextjsChunkCssAssetNames.length > 0) {
|
|
156
|
+
for (const assetName of fuckNextjsChunkCssAssetNames){
|
|
157
|
+
compilation.deleteAsset(assetName);
|
|
158
|
+
}
|
|
159
|
+
}
|
|
153
160
|
}
|
|
154
161
|
}
|
|
155
162
|
const stylexCSS = getStyleXRules(this.stylexRules, this.useCSSLayers);
|
|
@@ -165,12 +172,6 @@ class StyleXPlugin {
|
|
|
165
172
|
*/ this._virtualModuleInstance.writeModule(VIRTUAL_ENTRYPOINT_CSS_PATH, finalCss.toString());
|
|
166
173
|
} else {
|
|
167
174
|
const stylexChunk = compilation.namedChunks.get(STYLEX_CHUNK_NAME);
|
|
168
|
-
console.log({
|
|
169
|
-
rulesFrom: Array.from(this.stylexRules.keys()),
|
|
170
|
-
mode: compiler.options.mode,
|
|
171
|
-
stylexChunk,
|
|
172
|
-
asssets: Object.keys(assets)
|
|
173
|
-
});
|
|
174
175
|
if (!stylexChunk) return;
|
|
175
176
|
// Let's find the css file that belongs to the stylex chunk
|
|
176
177
|
const stylexChunkCssAssetNames = Object.keys(assets).filter((assetName)=>stylexChunk.files.has(assetName) && assetName.endsWith('.css'));
|
|
@@ -181,10 +182,6 @@ class StyleXPlugin {
|
|
|
181
182
|
console.warn('[stylex-webpack] Multiple CSS assets found for the stylex chunk. This should not happen. Please report this issue.');
|
|
182
183
|
}
|
|
183
184
|
const stylexAssetName = stylexChunkCssAssetNames[0];
|
|
184
|
-
console.log({
|
|
185
|
-
finalCss,
|
|
186
|
-
stylexAssetName
|
|
187
|
-
});
|
|
188
185
|
compilation.updateAsset(stylexAssetName, ()=>new RawSource(finalCss), {
|
|
189
186
|
minimized: false
|
|
190
187
|
});
|