Luismahou / grunt-hashres

Hashes your js and css files and rename the <script> and <link> declarations that refer to them in your html/php/etc files.
MIT License
115 stars 41 forks source link

Issue multiple replace js files #48

Closed XciD closed 2 years ago

XciD commented 9 years ago

Hi,

I'm trying to replace my angular controllers and there is my issue

hashres conf :

module.exports = {
    options: {
        encoding: 'utf8',
        fileNameFormat: '${hash}.${ext}',
        renameFiles: true
    },
    dist: {
        src: [
            '<%= pkg.path.dist %>js/app.min.js',
            '<%= pkg.path.dist %>css/app.min.css'
        ],
        dest: '<%= pkg.path.dist %>index.html'
    },
    test: {
        src: [
            '<%= pkg.path.dist %>js/controllers/login/login.js',
            '<%= pkg.path.dist %>js/controllers/login/activation.js',
            '<%= pkg.path.dist %>js/controllers/login/forgot.js'
        ],

        dest: '<%= pkg.path.dist %>test'
    }
};

There is the test file :

js/controllers/login/login.js
js/controllers/login/activation.js
js/controllers/login/forgot.js

And the output test file :

js/controllers/login/6138e561.js
js/controllers/login/6138e561.js
js/controllers/login/6138e561.js

And the output console :

Running "hashres:test" (hashres) task
dist/js/controllers/login/login.js >> 6138e561.js
dist/js/controllers/login/activation.js >> 24bc3789.js
dist/js/controllers/login/forgot.js >> 6b402978.js

Some have the solution ?

dancetrain commented 9 years ago

I had same issue, fixed it with this commit https://github.com/dancetrain/grunt-hashres/commit/de5aeaf45e70dca10e6dbacc26811f20ed16a704