@lwrjs/fs-asset-provider 0.4.2 → 0.4.6
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/index.cjs +5 -8
- package/package.json +4 -4
package/build/cjs/index.cjs
CHANGED
|
@@ -6,12 +6,10 @@ var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
|
6
6
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
7
7
|
var __markAsModule = (target) => __defProp(target, "__esModule", {value: true});
|
|
8
8
|
var __export = (target, all) => {
|
|
9
|
-
__markAsModule(target);
|
|
10
9
|
for (var name in all)
|
|
11
10
|
__defProp(target, name, {get: all[name], enumerable: true});
|
|
12
11
|
};
|
|
13
12
|
var __exportStar = (target, module2, desc) => {
|
|
14
|
-
__markAsModule(target);
|
|
15
13
|
if (module2 && typeof module2 === "object" || typeof module2 === "function") {
|
|
16
14
|
for (let key of __getOwnPropNames(module2))
|
|
17
15
|
if (!__hasOwnProp.call(target, key) && key !== "default")
|
|
@@ -20,12 +18,11 @@ var __exportStar = (target, module2, desc) => {
|
|
|
20
18
|
return target;
|
|
21
19
|
};
|
|
22
20
|
var __toModule = (module2) => {
|
|
23
|
-
|
|
24
|
-
return module2;
|
|
25
|
-
return __exportStar(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", {value: module2, enumerable: true}), module2);
|
|
21
|
+
return __exportStar(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", module2 && module2.__esModule && "default" in module2 ? {get: () => module2.default, enumerable: true} : {value: module2, enumerable: true})), module2);
|
|
26
22
|
};
|
|
27
23
|
|
|
28
24
|
// packages/@lwrjs/fs-asset-provider/src/index.ts
|
|
25
|
+
__markAsModule(exports);
|
|
29
26
|
__export(exports, {
|
|
30
27
|
default: () => src_default
|
|
31
28
|
});
|
|
@@ -53,7 +50,7 @@ var FsAssetProvider = class {
|
|
|
53
50
|
} = providerConfig;
|
|
54
51
|
this.emitter = appEmitter;
|
|
55
52
|
if (watchFiles) {
|
|
56
|
-
this.watcher = import_shared_utils.setupWatcher(this.onModuleChange.bind(this));
|
|
53
|
+
this.watcher = (0, import_shared_utils.setupWatcher)(this.onModuleChange.bind(this));
|
|
57
54
|
}
|
|
58
55
|
}
|
|
59
56
|
async onModuleChange(fileChanged) {
|
|
@@ -71,13 +68,13 @@ var FsAssetProvider = class {
|
|
|
71
68
|
async getAsset(fullAssetPath) {
|
|
72
69
|
fullAssetPath = decodeURI(fullAssetPath);
|
|
73
70
|
if (!this.cachedAssets.has(fullAssetPath)) {
|
|
74
|
-
const ext = import_path.extname(`x.${fullAssetPath}`).toLowerCase().substr(1);
|
|
71
|
+
const ext = (0, import_path.extname)(`x.${fullAssetPath}`).toLowerCase().substr(1);
|
|
75
72
|
if (ext && import_fs.default.existsSync(fullAssetPath)) {
|
|
76
73
|
const ownHash = await hash(fullAssetPath);
|
|
77
74
|
const assetDef = {
|
|
78
75
|
entry: fullAssetPath,
|
|
79
76
|
ext,
|
|
80
|
-
mime: import_mime_types.lookup(fullAssetPath),
|
|
77
|
+
mime: (0, import_mime_types.lookup)(fullAssetPath),
|
|
81
78
|
ownHash,
|
|
82
79
|
stream: (encoding) => import_fs.default.createReadStream(fullAssetPath, {encoding}),
|
|
83
80
|
content: (encoding) => import_fs.default.readFileSync(fullAssetPath, encoding).toString()
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
7
|
-
"version": "0.4.
|
|
7
|
+
"version": "0.4.6",
|
|
8
8
|
"homepage": "https://lwr.dev/",
|
|
9
9
|
"repository": {
|
|
10
10
|
"type": "git",
|
|
@@ -30,15 +30,15 @@
|
|
|
30
30
|
"build/**/*.d.ts"
|
|
31
31
|
],
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@lwrjs/shared-utils": "0.4.
|
|
33
|
+
"@lwrjs/shared-utils": "0.4.6",
|
|
34
34
|
"mime-types": "^2.1.27"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
|
-
"@lwrjs/types": "0.4.
|
|
37
|
+
"@lwrjs/types": "0.4.6",
|
|
38
38
|
"@types/mime-types": "2.1.0"
|
|
39
39
|
},
|
|
40
40
|
"engines": {
|
|
41
41
|
"node": ">=14.15.4 <15"
|
|
42
42
|
},
|
|
43
|
-
"gitHead": "
|
|
43
|
+
"gitHead": "71f599b20c35d612e55312e94804a97e7cc778e1"
|
|
44
44
|
}
|