static-dev
Version:
HTML developer template.
76 lines (54 loc) • 1.43 kB
Markdown
## Getting Started
This plugin requires Grunt `~0.4.0`
If you haven't used [Grunt](http://gruntjs.com/) before, be sure to check out the [Getting Started](http://gruntjs.com/getting-started) guide, as it explains how to create a [Gruntfile](http://gruntjs.com/sample-gruntfile) as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:
```shell
npm install static-dev
```
Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
```js
grunt.loadNpmTasks('static-dev');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
staticdev:{
demo:{
src : "src/html/*",
dest : "pages/"
}
},
watch: {
html: {
files: ["src/html/*","src/html/common/*"],
tasks: ['staticdev:demo']
}
}
});
//Making grunt default to force in order not to break the project.
grunt.option('force', true);
//Default task(s).
grunt.registerTask('default', ['staticdev','watch']);
```
### Example
src/html/index.html
```html
<html>
<head></head>
<body>
<!--include common/test.html-->
</body>
</html>
```
src/common/test.html
```html
test
```
#### Output
pages/index.html
```html
<html>
<head></head>
<body>
test
</body>
</html>
```