static web app workflow
$ npm install tdn-pages
# or yarn
$ yarn add tdn-pages
有三个命令可以使用
tdn-pages clean
清除构建文件夹
tdn-pages develop
静态开发网页 会开启开发服务器,提供热更新
支持e6+和scss开发
tdn-pages build
构建生产环境代码
在根目录添加文件pages.config.js 可以配置初始化 文件路径和文件名称和页面数据
默认为
module.exports = {
build: {
// 代码开发路径
src: 'src',
// 生产路径
dist: 'dist',
// 临时文件路径
temp: 'temp',
// 公共文件路径
public: 'public',
paths: {
// 样式
styles: 'assets/styles/*.scss',
// js
scripts: 'assets/scripts/*.js',
// 页面
pages: '*.html',
// 图片
images: 'assets/images/**',
// 字体
fonts: 'assets/fonts/**',
}
},
// 页面渲染引擎数据
data: {
menus: [
{
name: 'Home',
icon: 'aperture',
link: 'index.html'
},
{
name: 'Features',
link: 'features.html'
},
{
name: 'About',
link: 'about.html'
},
{
name: 'Contact',
link: '#',
children: [
{
name: 'Twitter',
link: 'https://twitter.com/w_zce'
},
{
name: 'About',
link: 'https://weibo.com/zceme'
},
{
name: 'divider'
},
{
name: 'About',
link: 'https://github.com/zce'
}
]
}
],
pkg: require('./package.json'),
date: new Date()
}
}
- Type:
string
- Details: name string
- Type:
string
- Details: host string
- Default:
'zce.me'
- Fork it on GitHub!
- Clone the fork to your own machine.
- Checkout your feature branch:
git checkout -b my-awesome-feature
- Commit your changes to your own branch:
git commit -am 'Add some feature'
- Push your work back up to your fork:
git push -u origin my-awesome-feature
- Submit a Pull Request so that we can review your changes.
NOTE: Be sure to merge the latest from "upstream" before making a pull request!
MIT © tdn 2387083001@qq.com