Skip to content

Commit 8f75881

Browse files
committed
Release 1.0.8
1 parent 8d7a0f8 commit 8f75881

3 files changed

Lines changed: 55 additions & 1 deletion

File tree

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = function noopScssLoader() {
2+
return 'module.exports = {};';
3+
};

bin/storefront-hot-proxy/patch-webpack-config.js

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,55 @@ function patchScssSidecarWatchBehavior(configArray) {
248248
}
249249
}
250250

251+
function walkRules(rules, callback) {
252+
if (!Array.isArray(rules)) {
253+
return;
254+
}
255+
256+
for (const rule of rules) {
257+
if (!rule || typeof rule !== 'object') {
258+
continue;
259+
}
260+
261+
callback(rule);
262+
263+
if (Array.isArray(rule.oneOf)) {
264+
walkRules(rule.oneOf, callback);
265+
}
266+
267+
if (Array.isArray(rule.rules)) {
268+
walkRules(rule.rules, callback);
269+
}
270+
}
271+
}
272+
273+
function isScssOrSassRule(rule) {
274+
return rule.test instanceof RegExp
275+
&& (rule.test.test('.scss') || rule.test.test('.sass'));
276+
}
277+
278+
function patchScssRulesToNoop(configArray) {
279+
const noopScssLoaderPath = path.resolve(__dirname, 'noop-scss-loader.js');
280+
281+
for (const config of configArray) {
282+
if (!config || typeof config !== 'object') {
283+
continue;
284+
}
285+
286+
walkRules(config?.module?.rules, (rule) => {
287+
if (!isScssOrSassRule(rule)) {
288+
return;
289+
}
290+
291+
rule.use = [
292+
{
293+
loader: noopScssLoaderPath,
294+
},
295+
];
296+
});
297+
}
298+
}
299+
251300
function stripWebpackBarPlugins(configArray) {
252301
for (const config of configArray) {
253302
if (!config || typeof config !== 'object' || !Array.isArray(config.plugins)) {
@@ -361,6 +410,8 @@ function loadPatchedWebpackConfig(explicitProjectRoot) {
361410
}
362411
console.log('[SidworksDevTools] SCSS sidecar mode enabled (webpack SCSS entry disabled)');
363412
patchScssSidecarWatchBehavior(configArray);
413+
patchScssRulesToNoop(configArray);
414+
console.log('[SidworksDevTools] SCSS sidecar mode: webpack SCSS imports disabled (handled by sidecar)');
364415
console.log('[SidworksDevTools] SCSS sidecar mode: webpack ignores SCSS/SASS change events (JS rebuilds only on JS changes)');
365416
}
366417

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"description": "Sidworks Developer tools for Shopware 6",
44
"type": "shopware-platform-plugin",
55
"license": "MIT",
6-
"version": "1.0.7",
6+
"version": "1.0.8",
77
"authors": [
88
{
99
"name": "Sidworks"

0 commit comments

Comments
 (0)