Compiling the html templates into on single JSON file.
npm install grunt-html2jsonCompile the html files into a JSON file.
npm install grunt-html2jsonThen add this line to your project's grunt.js gruntfile:
``javascript`
grunt.loadNpmTasks('grunt-html2json');
[grunt]: http://gruntjs.com/
[getting_started]: https://github.com/gruntjs/grunt/blob/master/docs/getting_started.md
javascript
grunt.initConfig({
html2json: {
dist: {
src: ['src/.txt', 'src/.html'],
dest: 'dist/built.json'
}
}
});`You might also want to trigger the compiled process by watching the file change.
Append following ine in the grunt.initConfig list.
`javascript
watch: {
files: '',
tasks: 'default'
}
``