非React框架,沿用Webpack打包,用于制作简单的页面,例如H5单页
- src/ 业务文件夹目录结构:
├── app // code from here
│ ├── fonts
│ │ ├── css.styl
│ │ └── index.js
│ ├── media // meida resource
│ │ ├── css.styl
│ │ └── index.js
│ ├── index.ejs // html temolate
│ ├── index.js // main js file
│ └── css.styl // main css file
├── modules // common files
│ ├── res/
│ ├── style/
│ └── utils/
└── vendor
├── copy/ // copy to build/vendor directly
└── SplitText.min.js
- webpack/ 打包配置目录:
├── entry.js
├── optimization.js
├── loaders.js
├── plugins.js
├── resolve.js
└── rules.js
- config.js 文件:
// webpack发布路径,以及其他一些分享信息,统一配置
{
// Deploy
public_path: 'webpack发布路径'
,port: 8686
,plugin_url: 'https://some.com'
,ga_id: 'UA-????'
,fb_id: '123456789'
,analyse_bundle: false
,image_min: true
// multi-pages
,page:{ // 你我新时代
title: '标题'
,desc: '描述'
,image: '预览图'
,url: 'html页面完整url'
,thumb: '微信分享方图'
}
}