oipage 1.2.0-alpha.1 → 1.2.0-alpha.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/README.md +1 -1
- package/bin/run +3 -1
- package/bin/serve.js +6 -3
- package/nodejs/animation/index.js +1 -1
- package/nodejs/cmdlog/index.js +1 -1
- package/nodejs/disk/index.js +1 -1
- package/nodejs/logform/index.js +1 -1
- package/nodejs/throttle/index.js +1 -1
- package/package.json +1 -1
- package/web/animation/index.js +1 -1
- package/web/onReady/index.js +1 -1
- package/web/style/index.js +1 -1
- package/web/throttle/index.js +1 -1
package/README.md
CHANGED
package/bin/run
CHANGED
package/bin/serve.js
CHANGED
|
@@ -47,12 +47,15 @@ module.exports = function (config) {
|
|
|
47
47
|
// 只处理非下载文件
|
|
48
48
|
// 过大的也不进行处理
|
|
49
49
|
if (urlArray[1] !== "download") {
|
|
50
|
-
for (let i = 0; i < config.
|
|
51
|
-
if (config.
|
|
52
|
-
source = config.
|
|
50
|
+
for (let i = 0; i < config.module.rules.length; i++) {
|
|
51
|
+
if (config.module.rules[i].test.test(filePath)) {
|
|
52
|
+
source = config.module.rules[i].use.call({
|
|
53
53
|
root: basePath, // 服务器根路径
|
|
54
54
|
path: filePath.replace(basePath, ""), // 文件相对路径
|
|
55
55
|
entry: headers.Accept !== "*/*", // 是否是浏览器地址栏直接访问
|
|
56
|
+
setFileType(fileType) { // 设置文件类型
|
|
57
|
+
responseHeader['Content-type'] = fileType + ";charset=utf-8";
|
|
58
|
+
}
|
|
56
59
|
}, source);
|
|
57
60
|
break;
|
|
58
61
|
}
|
package/nodejs/cmdlog/index.js
CHANGED
package/nodejs/disk/index.js
CHANGED
package/nodejs/logform/index.js
CHANGED
package/nodejs/throttle/index.js
CHANGED
package/package.json
CHANGED
package/web/animation/index.js
CHANGED
package/web/onReady/index.js
CHANGED
package/web/style/index.js
CHANGED
package/web/throttle/index.js
CHANGED