This repository was archived by the owner on Apr 2, 2025. It is now read-only.
- Notifications
You must be signed in to change notification settings - Fork 0
Home
PatternDirClean edited this page Oct 29, 2020
·
8 revisions
这里可以让你快速开始框架的使用
以下的操作均在 PDWbpack 文件夹下
在 /cofig/pathConf.js 中修改
变量均可修改,可自行添加定义路径常量,可在配置中压缩传入的路径参数
也可以不使用其中的变量,传入完整的路径,建议使用,可减少代码量增加可读性
在代码文件中写入
// js 文件夹global.JsPath=Root+'js/';在配置文件中使用
// 不使用变量
Out: {urlOf: 'F:/Code/web/PDWebapck/js/'}// 使用变量
Out: {urlOf: JsPath}RootPath 常量不建议修改
在 /cofig/conf.js 中修改
快速使用可不修改,或仅修改 devtool 部分
此处代码写入 /run.js
使用框架的加载对象 confload 载入并配置模块和页面,并将其联系起来
// 初始化运行,即指定第一个使用的模块,默认为 undefined 直接 then 会报错confload.runOf('ModeLoad',(modeload)=>{// 公共模块,全部页面都会加入该类型的模块modeload.publicMode('app',JsPath+'app.js',"defer");// 私有模块,该类型的模块需要在添加页面的时候声明才能使用modeload.addMode('index',JsPath+'index.js',"defer");modeload.addMode('main',JsPath+'main.js',"defer");// 下一个要用的模块return'PageLoad';}).then((pageLoad)=>{// 添加页面,并附上对应的模块pageLoad.addPage('index',SourcePath+'index.html',['index']);pageLoad.addPage('main',SourcePath+'main.html',['main']);// 不返回即继续使用该模块});/* 上面的操作传入的参数均为 [输出的名称,路径,附加选项] */- 配置文件,启动框架并连接用户代码
/webpack.conf.js - 加载顺序表
/PDWebpack/load/load.js - 导入外置依赖
/PDWebpack/load/requireLib.js - 路径常量
/PDWebpack/config/pathConf.js - webpack 配置模版
/PDWebpack/config/webpack/conf.js - 框架配置转 webpack 配置工具
/PDWebpack/lib/confToWebpack.js - 框架配置文件
/PDWebpack/config/conf.js - 框架模块加载工具
/PDWebpack/lib/confload/ConfigLoad.js - 框架模块
/PDWebpack/lib/confload/INCL.js - webpack 模块配置
/PDWebpack/config/plugins/pluginsload.js
