@lwrjs/lwc-module-provider 0.6.0 → 0.6.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/build/cjs/compiler.cjs +3 -2
- package/build/cjs/index.cjs +3 -1
- package/build/es/compiler.js +2 -1
- package/build/es/index.js +2 -0
- package/package.json +4 -4
package/build/cjs/compiler.cjs
CHANGED
|
@@ -39,7 +39,7 @@ var DEFAULT_BABEL_CONFIG = {
|
|
|
39
39
|
};
|
|
40
40
|
var LwcCompiler = class {
|
|
41
41
|
async compileFile(source, config) {
|
|
42
|
-
const {name, namespace, filename} = config;
|
|
42
|
+
const {name, namespace, filename, scopedStyles} = config;
|
|
43
43
|
if (source.startsWith(import_utils.EXPLICIT_CONSTANT)) {
|
|
44
44
|
return {
|
|
45
45
|
code: source,
|
|
@@ -70,7 +70,8 @@ var LwcCompiler = class {
|
|
|
70
70
|
name,
|
|
71
71
|
experimentalDynamicComponent: {
|
|
72
72
|
strictSpecifier: false
|
|
73
|
-
}
|
|
73
|
+
},
|
|
74
|
+
scopedStyles
|
|
74
75
|
});
|
|
75
76
|
return {
|
|
76
77
|
code: compilerResult.code,
|
package/build/cjs/index.cjs
CHANGED
|
@@ -90,10 +90,12 @@ var LwcModuleProvider = class {
|
|
|
90
90
|
let compiledModule = moduleFsCacheEnabled && (0, import_cache.getCompiledModuleCacheEntry)(moduleSource, cacheConfig);
|
|
91
91
|
if (!compiledModule) {
|
|
92
92
|
const [name] = rawName.split("#");
|
|
93
|
+
const scopedStyles = moduleEntry.entry.endsWith(".css") && moduleEntry.specifier.endsWith("?scoped=true");
|
|
93
94
|
compiledModule = await this.lwcCompiler.compileFile(originalSource, {
|
|
94
95
|
namespace,
|
|
95
96
|
name,
|
|
96
|
-
filename: moduleEntry.entry
|
|
97
|
+
filename: moduleEntry.entry,
|
|
98
|
+
scopedStyles
|
|
97
99
|
});
|
|
98
100
|
if (moduleFsCacheEnabled) {
|
|
99
101
|
(0, import_cache.addCompiledModuleCacheEntry)(moduleSource, compiledModule, cacheConfig);
|
package/build/es/compiler.js
CHANGED
|
@@ -12,7 +12,7 @@ const DEFAULT_BABEL_CONFIG = {
|
|
|
12
12
|
export class LwcCompiler {
|
|
13
13
|
// compileFile takes a html, css, typecsript, etc, and transforms it to a es6 module
|
|
14
14
|
async compileFile(source, config) {
|
|
15
|
-
const { name, namespace, filename } = config;
|
|
15
|
+
const { name, namespace, filename, scopedStyles } = config;
|
|
16
16
|
if (source.startsWith(EXPLICIT_CONSTANT)) {
|
|
17
17
|
return {
|
|
18
18
|
code: source,
|
|
@@ -45,6 +45,7 @@ export class LwcCompiler {
|
|
|
45
45
|
experimentalDynamicComponent: {
|
|
46
46
|
strictSpecifier: false,
|
|
47
47
|
},
|
|
48
|
+
scopedStyles,
|
|
48
49
|
});
|
|
49
50
|
return {
|
|
50
51
|
code: compilerResult.code,
|
package/build/es/index.js
CHANGED
|
@@ -64,11 +64,13 @@ export default class LwcModuleProvider {
|
|
|
64
64
|
let compiledModule = moduleFsCacheEnabled && getCompiledModuleCacheEntry(moduleSource, cacheConfig);
|
|
65
65
|
if (!compiledModule) {
|
|
66
66
|
const [name] = rawName.split('#');
|
|
67
|
+
const scopedStyles = moduleEntry.entry.endsWith('.css') && moduleEntry.specifier.endsWith('?scoped=true');
|
|
67
68
|
// We need to convert anything (html, css, javascript) into a canonical ES6 module
|
|
68
69
|
compiledModule = await this.lwcCompiler.compileFile(originalSource, {
|
|
69
70
|
namespace,
|
|
70
71
|
name,
|
|
71
72
|
filename: moduleEntry.entry,
|
|
73
|
+
scopedStyles,
|
|
72
74
|
});
|
|
73
75
|
if (moduleFsCacheEnabled) {
|
|
74
76
|
addCompiledModuleCacheEntry(moduleSource, compiledModule, cacheConfig);
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
7
|
-
"version": "0.6.
|
|
7
|
+
"version": "0.6.4",
|
|
8
8
|
"homepage": "https://developer.salesforce.com/docs/platform/lwr/overview",
|
|
9
9
|
"repository": {
|
|
10
10
|
"type": "git",
|
|
@@ -32,14 +32,14 @@
|
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@babel/preset-typescript": "^7.9.0",
|
|
34
34
|
"@lwc/module-resolver": "2.5.8",
|
|
35
|
-
"@lwrjs/shared-utils": "0.6.
|
|
35
|
+
"@lwrjs/shared-utils": "0.6.4",
|
|
36
36
|
"es-module-lexer": "^0.3.18"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
|
-
"@lwrjs/types": "0.6.
|
|
39
|
+
"@lwrjs/types": "0.6.4"
|
|
40
40
|
},
|
|
41
41
|
"engines": {
|
|
42
42
|
"node": ">=14.15.4 <17"
|
|
43
43
|
},
|
|
44
|
-
"gitHead": "
|
|
44
|
+
"gitHead": "80b73fe4558dc3db0afcdbe80eb17f5a1464e34e"
|
|
45
45
|
}
|