Giter VIP home page Giter VIP logo

Comments (12)

pgilad avatar pgilad commented on May 22, 2024

Did you try using the options targetPrefix ?

What Dest directory are you referring to? the one that the compiled css/js gets compiled to or the ones for the destination jade file?

from grunt-jade-usemin.

skotchio avatar skotchio commented on May 22, 2024

@pgilad Thanks for the help, options targetPrefix is that I need 👍

from grunt-jade-usemin.

skotchio avatar skotchio commented on May 22, 2024

It's seem I have found a bug when using options targetPrefix provided. On the following config:

    jadeUsemin: {
        vendor: {
            options: {
                tasks: {
                    js: ['concat', 'filerev'],
                    css: ['concat', 'filerev']
                },
                targetPrefix: '.tmp',
                dirTasks: 'filerev'
            },
            files: [{
                    expand: true,
                    cwd: "src/to/views",
                    src: ['*.jade'],
                    dest: 'build/views'
                }
            ]
        }
    }

Paths In the compiled views added without filerev hashes.

from grunt-jade-usemin.

pgilad avatar pgilad commented on May 22, 2024

Can you try running grunt jadeUsemin:vendor --verbose?

from grunt-jade-usemin.

skotchio avatar skotchio commented on May 22, 2024

@pgilad unfortunately I can't show my technical detail for all. Please could you try my config yourself?

from grunt-jade-usemin.

pgilad avatar pgilad commented on May 22, 2024

I could but I don't have your dir file structure and/or your files...
Also you are getting targetPrefix options wrong. Why do you want to output compiled files there?

How do you run your task?

from grunt-jade-usemin.

skotchio avatar skotchio commented on May 22, 2024

Why I'm using targetPrefix option wrong? A need to reside files to .tmp directory first because I use google closure compiler for my js files but it does't support destination directory as source one.

I run my task via Gruntfile.

from grunt-jade-usemin.

pgilad avatar pgilad commented on May 22, 2024

I'm going to need either a verbose log (run with grunt jadeUsemin --verbose) or access to the files, since I can't use your config without the files.

Perhaps try to create a minimum test case where the task fails so that this can be debugged.

The targetPrefix + filerev have been successfully used by others & me, and also have passing tests for them, so either it's an edge case that doesn't get handled right or you might be using it wrong

from grunt-jade-usemin.

ppitonak avatar ppitonak commented on May 22, 2024

Hi, I had the same error as @skotchio that paths in the compiled views had no filerev hashes.

The problem was caused by missing / at the end in prefix and targetPrefix. @pgilad you can try this by removing slash in Gruntfile.js: https://github.com/pgilad/grunt-jade-usemin/blob/master/Gruntfile.js#L69-L70 ... tests will fail.

from grunt-jade-usemin.

ppitonak avatar ppitonak commented on May 22, 2024

It's a problem with targetPrefix, when only prefix doesn't contain slash, tests pass.

from grunt-jade-usemin.

pgilad avatar pgilad commented on May 22, 2024

Hi, thanks for the discovery, can you create a failing PR test case for this (and a possible fix)?
I think we can easily make sure prefix contains an ending slash...

from grunt-jade-usemin.

pgilad avatar pgilad commented on May 22, 2024

Fixed and thanks to @ppitonak for the help...

from grunt-jade-usemin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.