静态网页开发工作构建流脚手架tdn-pages(基于gulp开发)

tdn-pages

码云

NPM Downloads
NPM Version
License
Dependency Status
devDependency Status
Code Style

static web app workflow

Installation

$ npm install tdn-pages

# or yarn
$ yarn add tdn-pages

Usage

有三个命令可以使用

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()
    }
}

API

tdnPages(name[, options])

name
  • Type: string
  • Details: name string
options
host
  • Type: string
  • Details: host string
  • Default: 'zce.me'

Contributing

  1. Fork it on GitHub!
  2. Clone the fork to your own machine.
  3. Checkout your feature branch: git checkout -b my-awesome-feature
  4. Commit your changes to your own branch: git commit -am 'Add some feature'
  5. Push your work back up to your fork: git push -u origin my-awesome-feature
  6. 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!

License

MIT © tdn 2387083001@qq.com

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值