grunt-mockjs-detach
v0.1.1
Published
Detach mockjs data on distill files with Grunt.
Downloads
4
Maintainers
Readme
grunt-mockjs-detach
A grunt plugin use for detach mockjs data source..
Getting Started
This plugin requires Grunt.
If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:
npm install grunt-mockjs-detach --save-dev
Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
grunt.loadNpmTasks('grunt-mockjs-detach');
The "mockjs_detach" task
Overview
In your project's Gruntfile, add a section named mockjs_detach
to the data object passed into grunt.initConfig()
.
grunt.initConfig({
mockjs_detach: {
options: {
begin: '<!-- mockjs -->', // default to: <!-- mockjs -->
end: '<!-- endmockjs -->' // default to: <!-- endmockjs -->
},
app: {
expand: true,
cwd: './dist',
src: '{,*/}*.html',
dest: './dist'
},
},
})
Options
options.begin
Type: String
Default value: <!-- mockjs -->
A string value that is used to detect mockjs data source start.
options.end
Type: String
Default value: <!-- endmockjs -->
A string value that is used to detect mockjs data source end.
Contributing
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using Grunt.
Release History
- v0.1.0 released - 2014/11/17.
License
Copyright (c) 2014 Colin. Licensed under the MIT license.