How to setup Gruntfile with html2js in my Yeoman project?

948 views Asked by At

I guess the title is quite trivial. I have been develeoping with AngularJS for a while and used grunt only for some projects and it's only with yeoman. So I can say that I'm quite new to grunt.

I have tried to follow the path in grunt-html2js page and managed to create templates.js with the following code:

html2js: {
            options: {

            },
            main: {
                src: ['app/views/**/*.html'],
                dest: 'dist/tmp/templates.js'
            }
        }, //...

Then below:

grunt.registerTask('build', [
        'clean:dist',
        'wiredep',
        'useminPrepare',
        'concurrent:dist',
        'autoprefixer',
        'concat',
        'ngmin',
        'copy:dist',
        'cdnify',
        'cssmin',
        'uglify',
        'filerev',
        'usemin',
        'htmlmin',
        'html2js' 
    ]);

What I try to do is wiring this file to the index.html and then remove the html files in the "views" folder.

Since this is a test project, file structure is pretty much same with a new yeoman project. Could somebody point me to the right direction?

Thanks in advance for any help...

0

There are 0 answers