Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

References in Subfolders not getting updated #243

Open
chibui opened this issue Sep 20, 2018 · 4 comments
Open

References in Subfolders not getting updated #243

chibui opened this issue Sep 20, 2018 · 4 comments

Comments

@chibui
Copy link

chibui commented Sep 20, 2018

I can't seem to get references in subfolders to update with the hashed name.

My config is :

cacheBust: { 
           test: {
               options: {
                   deleteOriginals: true,
                   assets: ['**/**.{css,html}'],
                   baseDir: 'dist'
               },
               files: [{
                   expand: true,
                   cwd: 'dist',
                   src: ['**/*.{html, js}',]
               }]
           }
       }

My app structure prior to running task :

app|
---|dist|
--------|child.html
--------|child.css
--------|foo|
------------|foo.html
------------|foo.css
------------|bar|
----------------|bar.html
----------------|bar.css
--------|noop|
---------------|noop.html
---------------|noop.css

When I run the task, all the file are correctly renamed with the hash val. The issue is that with the exception of the reference in child.html being updated, none of the other references are updated.

foo.html

<!doctype html>
<html>
<head>
    <link href="foo.css" type="text/css" rel="stylesheet" />
</head>
<body>
<h2>FOO!!!</h2>
</body>
</html>

I've tried various configs but without any success. I've even tried to reference the source files directly.

files: [{
    expand: true,
    cwd: 'dist/',
    src: ['dist/foo/**/*.html', 'dist/noop/**/*.html']
 }]

and also

src: [ 'dist/foo/*.html', 'dist/noop/*.html']

Im using grunt-cache-bust v 1.7.0

Thanks in advance.

@osamamaruf
Copy link

osamamaruf commented Oct 24, 2018

+1 facing the same issue on grunt-cache-bust v 1.7.0. Any workarounds?

@pankaj-arunsingh
Copy link

+1 I faced the same issue. Seems like there is a PR #245 which should fix it. We should wait for it to be merged soon.

@Taelkir
Copy link

Taelkir commented Feb 21, 2019

Running Windows and having the same issue, but the code from the PR doesn't seem to solve it for me. Instead, in node_modules\grunt-cache-bust\tasks\cachebust.js I changed the loop at line 134 to start from 0 instead of 1.

Made my own PR at #250 - hopefully this helps someone else.

Taelkir added a commit to Taelkir/grunt-cache-bust that referenced this issue Feb 21, 2019
benhoIIand#243

This change fixed this ^ issue for me and started altering .html files in subfolders.
@dikaso
Copy link

dikaso commented Jul 30, 2019

I can also confirm that #250 works as expected (Linux).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants