Skip to content
This repository was archived by the owner on Apr 2, 2025. It is now read-only.

Commit fb2597f

Browse files
调整注释
1 parent ee50c3f commit fb2597f

19 files changed

Lines changed: 842 additions & 310 deletions

PDWebpack/cofig/conf.js

Lines changed: 49 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,67 @@
11
/** 框架配置
22
*
3+
* @author fybug
34
* @version 0.0.1
45
* @since PDWebpack 0.0.1
6+
* @class Conf
57
*/
68
global.Conf = {
7-
/** 加载模块加载顺序 */
9+
/** 加载模块加载顺序
10+
*
11+
* @type ('ModeLoad'|'PageLoad'|'AnonymousLoad')[]
12+
*/
813
configload: ['ModeLoad', 'PageLoad'],
914

10-
// // 全局输出配置
11-
// Out: {
12-
// // 编译资源后的替换的 url 地址
13-
// urlOf: ''
14-
// },
15-
// // 模块输出配置
16-
// jsOut: {
17-
// outName: '[hash:12][name][id].js'
18-
// },
19-
// // css 输出配置
20-
// cssOut: {
21-
// urlOf: './',
22-
// outName: '[hash:12][name][id].css'
23-
// },
24-
// // 字体文件输出配置
25-
// fontOut: {
26-
// urlOf: './',
27-
// outName: 'static/[name].[ext]'
28-
// },
29-
// // 图片输出配置
30-
// imgOut: {
31-
// urlOf: './',
32-
// outName: 'static/[id][name][hash:9].[ext]'
33-
// },
15+
// 全局输出配置
16+
Out: {
17+
/** 编译资源后的替换的 url 地址
18+
*
19+
* @type string
20+
*/
21+
urlOf: ''
22+
},
23+
// 模块输出配置
24+
jsOut: {
25+
/** 输出名称
26+
*
27+
* @type string
28+
*/
29+
outName: '[hash:12][name][id].js'
30+
},
31+
// css 输出配置
32+
cssOut: {
33+
urlOf: './',
34+
outName: '[hash:12][name][id].css'
35+
},
36+
// 字体文件输出配置
37+
fontOut: {
38+
urlOf: './',
39+
outName: 'static/[name].[ext]'
40+
},
41+
// 图片输出配置
42+
imgOut: {
43+
urlOf: './',
44+
outName: 'static/[id][name][hash:9].[ext]'
45+
},
3446

3547
/** 开发者模式下的专属配置 */
3648
devtool: {
3749
/** 测试状态模块输出名称 */
3850
jsOut: {outName: '[name].js'},
39-
/** 测试服务器端口 */
51+
/** 测试服务器端口
52+
*
53+
* @type number
54+
*/
4055
port: 3000,
41-
/** 测试服务器访问地址 */
56+
/** 测试服务器访问地址
57+
*
58+
* @type string
59+
*/
4260
host: "localhost",
43-
/** 测试过程存放路径 */
61+
/** 测试过程存放路径
62+
*
63+
* @type string
64+
*/
4465
contentBase: './build'
4566
}
4667
};

PDWebpack/cofig/pathConf.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
/* 路径常量 */
22

33
/** 项目根目录
4+
*
45
* @author fybug
56
* @since PDWebpack 0.0.1
67
*/
78
global.RootPath = path.resolve(__dirname, '../../') + '/';
89
/** 全局输出路径
10+
*
911
* @author fybug
1012
* @since PDWebpack 0.0.1
1113
*/

PDWebpack/cofig/plugins/HtmlWebpackPlugin.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
/** HtmlWebpackPlugin 基础基础
2-
*
1+
/**
32
* @author fybug
43
* @version 0.0.1
54
* @since PDWebpack 0.0.1
5+
*
6+
* @return {{meta:Object,cache:boolean,minify:Object}}
67
*/
7-
WebPackPlugins.HtmlWebpackPlugin = () => {
8+
module.exports = () => {
89
return {
910
meta: {
1011
"viewport": "width=device-width, initial-scale=1, shrink-to-fit=n",
Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
1-
/** ScriptExtHtmlWebpackPlugin 基础配置对象
2-
*
1+
/**
32
* @author fybug
43
* @version 0.0.1
54
* @since PDWebpack 0.0.1
5+
*
6+
* @return {{
7+
* sync:string[],
8+
* defer:string[],
9+
* async:string[]
10+
* }}
611
*/
7-
WebPackPlugins.ScriptExtHtmlWebpackPlugin = () => {
12+
module.exports = () => {
813
return {sync: [], defer: [], async: []}
914
};

PDWebpack/cofig/plugins/pluginsload.js

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,19 @@
66
* @author fybug
77
* @version 0.0.1
88
* @since PDWebpack 0.0.1
9+
* @class WebPackPlugins
910
*/
10-
global.WebPackPlugins = {};
11-
12-
require('./ScriptExtHtmlWebpackPlugin');
13-
require('./HtmlWebpackPlugin');
11+
global.WebPackPlugins = {
12+
/** HtmlWebpackPlugin 基础基础
13+
*
14+
* @class HtmlWebpackPlugin
15+
* @constructs
16+
*/
17+
HtmlWebpackPlugin: require('./HtmlWebpackPlugin'),
18+
/** ScriptExtHtmlWebpackPlugin 基础配置对象
19+
*
20+
* @class ScriptExtHtmlWebpackPlugin
21+
* @constructs
22+
*/
23+
ScriptExtHtmlWebpackPlugin: require('./ScriptExtHtmlWebpackPlugin')
24+
};

PDWebpack/cofig/webpack/conf.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,19 @@
66
* @author fybug
77
* @version 0.0.1
88
* @since PDWebpack 0.0.1
9+
*
10+
* @return {{
11+
* output:{
12+
* filename:string,
13+
* path:string,
14+
* publicPath:string
15+
* },
16+
* externals:Object,
17+
* resolve:{extensions:string[]}
18+
* module:{rules:{}},
19+
* plugins:Object[],
20+
* performance:{hints:boolean}
21+
* }}
922
*/
1023
global.WebpackConf = () => {
1124
// 实例化框架配置读取工具
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
/** 脱离的第三方库 */
1+
/** 脱离的第三方库
2+
*
3+
* @return {Object}
4+
*/
25
module.exports = (confget, conf) => {
36
return {};
47
};

PDWebpack/cofig/webpack/plugins.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
/** 加载的插件 */
1+
/** 加载的插件
2+
*
3+
* @return {Object[]}
4+
*/
25
module.exports = (confget, conf) => [
36
// 清理输出
47
new CleanWebpackPlugin({dry: false, protectWebpackAssets: true}),

PDWebpack/cofig/webpack/resolve.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
/** 自动补充文件拓展 */
1+
/** 自动补充文件拓展
2+
*
3+
* @return {{extensions:string[]}}
4+
*/
25
module.exports = (confget, conf) => {
36
return {extensions: ['.js', '.jsx']};
47
};

PDWebpack/cofig/webpack/rules.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
/** 文件加载规则 */
1+
/** 文件加载规则
2+
*
3+
* @return {{}[]}
4+
*/
25
module.exports = (confget, conf) => [
36
// css 和 postcss 的加载处理
47
{

0 commit comments

Comments
 (0)