grunt-cms-file-writer-syncer

0.1.4 • Public • Published

grunt-cms-file-writer-syncer

使用grunt将文件直接推送至CMS-FILE-WRITER,从而通过命令行即可完成上线

使用说明

添加依赖

npm install grunt-cms-file-writer-syncer --save-dev

或者在package.json添加devDependencies添加依赖:

"devDependencies": {
    "grunt-cms-file-writer-syncer" : "latest",
}

在你的Gruntfile中添加引用

grunt.loadNpmTasks('grunt-cms-file-writer-syncer');

The "cms-file-writer-syncer" task

Overview

在你的项目中,在Gruntfile中添加配置 cms-file-writer-syncer.

grunt.initConfig({
  "cms-file-writer-syncer": {
    options: {
        remote : ""//远程文件夹路径
    },
    files: [{
      expand: true,
      filter: 'isFile',
      cwd: "dist",
      src: ['**/*.html' , '**/*.js' , '**/*.css' , '**/*.xml' , '**/*.json']
    }]
  },
});

参数说明

options.remote

类型: String

远程文件夹路径,注意与其他文件造成冲突,请小心定义,如果仅仅是测试用途,请填写/test

文件访问说明

外部访问

http://c.youdao.com/{options.remote}/{filepath}(TTL:10分钟)
http://c.ydstatic.com/{options.remote}/{filepath}(TTL:1天)

机群内部访问

http://sb126x.corp.youdao.com:10050/{options.remote}/{filepath}

其他

Readme

Keywords

none

Package Sidebar

Install

npm i grunt-cms-file-writer-syncer

Weekly Downloads

6

Version

0.1.4

License

none

Last publish

Collaborators

  • smildlzj