akfun 3.1.2 → 3.1.3
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 +14 -14
- package/src/webpack/webpack.dev.conf.js +7 -5
package/package.json
CHANGED
package/src/dev-server.js
CHANGED
|
@@ -115,21 +115,21 @@ module.exports = function (akfunConfig, _consoleTag) {
|
|
|
115
115
|
const uri = `http://${config.dev.hostname}:${port}`;
|
|
116
116
|
|
|
117
117
|
console.log(`> Listening at ${uri}\n`);
|
|
118
|
-
|
|
118
|
+
spinner.succeed(`${consoleTag}调试模式已开启!`);
|
|
119
|
+
// 打印当前环境中的首个html和css地址
|
|
120
|
+
const projPath = `${uri}${webpackConfig.output.publicPath}`;
|
|
121
|
+
let entryConfig = webpackConfig.entry || {}; // 获取构建入口配置
|
|
122
|
+
const entryFiles = (entryConfig && Object.keys(entryConfig)) || [];
|
|
123
|
+
if (entryFiles.length > 0) {
|
|
124
|
+
// 获取第一个入口文件
|
|
125
|
+
const filename = entryFiles[0];
|
|
126
|
+
console.info(
|
|
127
|
+
`当前运行脚本:\n ${projPath}${filename}.js\n当前运行样式[可能不存在]:\n${projPath}${filename}.css`
|
|
128
|
+
);
|
|
129
|
+
}
|
|
130
|
+
// 是否自动打开浏览器并跳到项目首页
|
|
119
131
|
if (autoOpenBrowser) {
|
|
120
|
-
|
|
121
|
-
// 打印当前环境中的首个html和css地址
|
|
122
|
-
const projPath = `${uri}${webpackConfig.output.publicPath}`;
|
|
123
|
-
let entryConfig = webpackConfig.entry || {}; // 获取构建入口配置
|
|
124
|
-
const entryFiles = (entryConfig && Object.keys(entryConfig)) || [];
|
|
125
|
-
if (entryFiles.length > 0) {
|
|
126
|
-
// 获取第一个入口文件
|
|
127
|
-
const filename = entryFiles[0];
|
|
128
|
-
console.info(
|
|
129
|
-
`当前运行脚本:\n ${projPath}${filename}.js\n当前运行样式[可能不存在]:\n${projPath}${filename}.css`
|
|
130
|
-
);
|
|
131
|
-
open(`${projPath}${filename}.html`, { wait: true });
|
|
132
|
-
}
|
|
132
|
+
open(`${projPath}${filename}.html`, { wait: true });
|
|
133
133
|
}
|
|
134
134
|
server = app.listen(port);
|
|
135
135
|
_resolve();
|
|
@@ -52,11 +52,13 @@ module.exports = (akfunConfig) => {
|
|
|
52
52
|
]
|
|
53
53
|
});
|
|
54
54
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
55
|
+
if (!webpackDevConfig.closeHtmlWebpackPlugin) {
|
|
56
|
+
// 使用用户自定义的多入口配置,生产对应的多页面多模板(优先使用用户的自定义页面模板)
|
|
57
|
+
const htmlWebpackPluginList = entrys2htmlWebpackPlugin(webpackDevConfig.entry, curHtmlTemplate);
|
|
58
|
+
htmlWebpackPluginList.forEach((htmlWebpackPlugin) => {
|
|
59
|
+
webpackDevConfig.plugins.push(htmlWebpackPlugin);
|
|
60
|
+
});
|
|
61
|
+
}
|
|
60
62
|
|
|
61
63
|
// 开启热更新能力
|
|
62
64
|
const devClientPath = path.resolve(__dirname, '../dev-client'); // 从akfun中获取
|