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

Add option to specify destination directory for taks #18

Closed
skotchio opened this issue Sep 27, 2014 · 12 comments
Closed

Add option to specify destination directory for taks #18

skotchio opened this issue Sep 27, 2014 · 12 comments

Comments

@skotchio
Copy link

It would be cool if you add option to specify destination directory for taks like the following:

jadeUsemin: {
    scripts: {
        options: {
            tasks: {
                js: ['concat', 'uglify'],
                css: ['concat', 'cssmin']
            },
            taskDestDir: './build'
        },
        files: [{
            dest: './src/partials/index.jade',
            src: './public/partials/index.jade'
        }]
    }
}
@pgilad
Copy link
Owner

pgilad commented Sep 27, 2014

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?

@skotchio
Copy link
Author

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

@skotchio skotchio reopened this Sep 28, 2014
@skotchio
Copy link
Author

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.

@pgilad
Copy link
Owner

pgilad commented Sep 28, 2014

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

@skotchio
Copy link
Author

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

@pgilad
Copy link
Owner

pgilad commented Sep 28, 2014

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?

@skotchio
Copy link
Author

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.

@pgilad
Copy link
Owner

pgilad commented Sep 28, 2014

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

@ppitonak
Copy link
Contributor

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.

@ppitonak
Copy link
Contributor

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

@pgilad
Copy link
Owner

pgilad commented Oct 22, 2014

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...

ppitonak added a commit to ppitonak/grunt-jade-usemin that referenced this issue Oct 22, 2014
@pgilad pgilad closed this as completed in e6113a2 Oct 22, 2014
@pgilad
Copy link
Owner

pgilad commented Oct 22, 2014

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

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

3 participants