akfun 3.1.5 → 3.1.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/package.json +1 -1
- package/src/dev-server.js +4 -4
- package/src/utils/getProjectDir.js +12 -2
package/package.json
CHANGED
package/src/dev-server.js
CHANGED
|
@@ -127,10 +127,10 @@ module.exports = function (akfunConfig, _consoleTag) {
|
|
|
127
127
|
console.info(
|
|
128
128
|
`当前运行脚本:\n ${projPath}${filename}.js\n当前运行样式[可能不存在]:\n${projPath}${filename}.css`
|
|
129
129
|
);
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
130
|
+
// 是否自动打开浏览器并跳转到第一个入口页面
|
|
131
|
+
if (!config.dev.closeHtmlWebpackPlugin && autoOpenBrowser) {
|
|
132
|
+
open(`${projPath}${filename}.html`, { wait: true });
|
|
133
|
+
}
|
|
134
134
|
}
|
|
135
135
|
server = app.listen(port);
|
|
136
136
|
_resolve();
|
|
@@ -7,10 +7,20 @@ module.exports = (_projectDir) => {
|
|
|
7
7
|
curProjectDir.push(resolveToCurrentRoot('./src'));
|
|
8
8
|
} else if (isArray(_projectDir)) {
|
|
9
9
|
_projectDir.forEach((dir) => {
|
|
10
|
-
|
|
10
|
+
if (dir.indexOf('/') === 0) {
|
|
11
|
+
// 判断是否是绝对路径
|
|
12
|
+
curProjectDir.push(dir);
|
|
13
|
+
} else {
|
|
14
|
+
curProjectDir.push(resolveToCurrentRoot(dir));
|
|
15
|
+
}
|
|
11
16
|
});
|
|
12
17
|
} else if (isString(_projectDir)) {
|
|
13
|
-
|
|
18
|
+
if (_projectDir.indexOf('/') === 0) {
|
|
19
|
+
// 判断是否是绝对路径
|
|
20
|
+
curProjectDir.push(_projectDir);
|
|
21
|
+
} else {
|
|
22
|
+
curProjectDir.push(resolveToCurrentRoot(_projectDir));
|
|
23
|
+
}
|
|
14
24
|
}
|
|
15
25
|
return curProjectDir;
|
|
16
26
|
};
|