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 CHANGED
@@ -45,7 +45,7 @@ npm install -g oipage
45
45
  npm install oipage --save
46
46
  ```
47
47
 
48
- 全局安装后,就可以直接作为命令行使用了。你可以打印帮助查看:
48
+ 安装后,就可以直接作为命令行使用了。你可以打印帮助查看:
49
49
 
50
50
  ```shell
51
51
  oipage-cli
package/bin/run CHANGED
@@ -23,7 +23,9 @@ if (process.argv[2] === "serve") {
23
23
  port: 8080,
24
24
  baseUrl: "./",
25
25
  },
26
- bundle: []
26
+ module: {
27
+ rules: []
28
+ }
27
29
  };
28
30
 
29
31
  // 如果设置了配置文件
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.bundle.length; i++) {
51
- if (config.bundle[i].test.test(filePath)) {
52
- source = config.bundle[i].handler.call({
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
  }
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * animation of OIPage v1.2.0-alpha.1
2
+ * animation of OIPage v1.2.0-alpha.2
3
3
  * git+https://github.com/oi-contrib/OIPage.git
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * cmdlog of OIPage v1.2.0-alpha.1
2
+ * cmdlog of OIPage v1.2.0-alpha.2
3
3
  * git+https://github.com/oi-contrib/OIPage.git
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * disk of OIPage v1.2.0-alpha.1
2
+ * disk of OIPage v1.2.0-alpha.2
3
3
  * git+https://github.com/oi-contrib/OIPage.git
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * logform of OIPage v1.2.0-alpha.1
2
+ * logform of OIPage v1.2.0-alpha.2
3
3
  * git+https://github.com/oi-contrib/OIPage.git
4
4
  */
5
5
  const {linelog} = require("../cmdlog/index.js");
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * throttle of OIPage v1.2.0-alpha.1
2
+ * throttle of OIPage v1.2.0-alpha.2
3
3
  * git+https://github.com/oi-contrib/OIPage.git
4
4
  */
5
5
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oipage",
3
- "version": "1.2.0-alpha.1",
3
+ "version": "1.2.0-alpha.2",
4
4
  "description": "前端网页或应用快速开发助手,包括开发服务器、辅助命令、实用API等",
5
5
  "sideEffects": false,
6
6
  "scripts": {
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * animation of OIPage v1.2.0-alpha.1
2
+ * animation of OIPage v1.2.0-alpha.2
3
3
  * git+https://github.com/oi-contrib/OIPage.git
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * onReady of OIPage v1.2.0-alpha.1
2
+ * onReady of OIPage v1.2.0-alpha.2
3
3
  * git+https://github.com/oi-contrib/OIPage.git
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * style of OIPage v1.2.0-alpha.1
2
+ * style of OIPage v1.2.0-alpha.2
3
3
  * git+https://github.com/oi-contrib/OIPage.git
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * throttle of OIPage v1.2.0-alpha.1
2
+ * throttle of OIPage v1.2.0-alpha.2
3
3
  * git+https://github.com/oi-contrib/OIPage.git
4
4
  */
5
5