@lwc/dev-server-plugin-lex 10.7.4 → 11.1.0
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.
|
@@ -43,8 +43,7 @@ function styleTransformer(src, id, options, hmrModuleContext) {
|
|
|
43
43
|
// If the file only contains imports, ignore as well
|
|
44
44
|
if (src.trim() === '' ||
|
|
45
45
|
(path.parse(id).name !== options.name &&
|
|
46
|
-
path.parse(id).name !== `${options.name}.scoped`)
|
|
47
|
-
!src.includes(`function ${STYLESHEET_IDENTIFIER}(`)) {
|
|
46
|
+
path.parse(id).name !== `${options.name}.scoped`)) {
|
|
48
47
|
return;
|
|
49
48
|
}
|
|
50
49
|
const code = `import { hot as __lwc_hmr_hot, swapStyle as __lwc_hmr_swapStyle } from 'lwc';
|
|
@@ -56,7 +55,10 @@ if (__lwc_hmr_hot) {
|
|
|
56
55
|
__lwc_hmr_hot.register('${hmrModuleContext.modulePath}', '${hmrModuleContext.moduleHash}', ${JSON.stringify(options)});
|
|
57
56
|
__lwc_hmr_hot.accept('${hmrModuleContext.modulePath}', (mod) => {
|
|
58
57
|
const { default: __new_styles } = mod;
|
|
59
|
-
if(
|
|
58
|
+
if(typeof ${STYLESHEET_IDENTIFIER} === 'undefined' || !__new_styles) {
|
|
59
|
+
__lwc_hmr_hot.invalidate('${hmrModuleContext.modulePath}');
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
60
62
|
__lwc_hmr_swapStyle(${STYLESHEET_IDENTIFIER}, __new_styles.at(-1)); // the default stylesheet is the last element
|
|
61
63
|
}
|
|
62
64
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"style.js","sourceRoot":"","sources":["../../src/transformers/style.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAkBA,
|
|
1
|
+
{"version":3,"file":"style.js","sourceRoot":"","sources":["../../src/transformers/style.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAkBA,4CA4CC;AA9DD,gDAAkC;AAClC,wCAA0E;AAK1E,MAAM,qBAAqB,GAAG,YAAY,CAAC;AAE3C;;;;;;;;;GASG;AACH,SAAgB,gBAAgB,CAC5B,GAAW,EACX,EAAU,EACV,OAAyB,EACzB,gBAAkC;IAElC,IAAI,CAAC;QACD,8DAA8D;QAC9D,oDAAoD;QACpD,IACI,GAAG,CAAC,IAAI,EAAE,KAAK,EAAE;YACjB,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,IAAI,KAAK,OAAO,CAAC,IAAI;gBACjC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,IAAI,KAAK,GAAG,OAAO,CAAC,IAAI,SAAS,CAAC,EACvD,CAAC;YACC,OAAO;QACX,CAAC;QAED,MAAM,IAAI,GAAG;;EAEnB,GAAG;;mDAE8C,gBAAgB,CAAC,UAAU;;8BAEhD,gBAAgB,CAAC,UAAU,OAAO,gBAAgB,CAAC,UAAU,MAAM,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC;4BAC5F,gBAAgB,CAAC,UAAU;;oBAEnC,qBAAqB;wCACD,gBAAgB,CAAC,UAAU;;;kCAGjC,qBAAqB;;;;CAItD,CAAC;QACM,OAAO;YACH,IAAI;YACJ,GAAG,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE;SACxB,CAAC;IACN,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACT,MAAM,IAAA,iCAAwB,EAAC,0BAAiB,CAAC,sBAAsB,EAAE,CAAC,EAAE;YACxE,QAAQ,EAAE,EAAE;SACf,CAAC,CAAC;IACP,CAAC;AACL,CAAC"}
|
package/package.json
CHANGED