Skip to content
This repository has been archived by the owner on Apr 20, 2018. It is now read-only.

setting build src to external endpoint (IE cdn URL) instead of relative? #576

Open
tconroy opened this issue Jul 31, 2015 · 0 comments
Open

Comments

@tconroy
Copy link

tconroy commented Jul 31, 2015

Hey there,

I posted a question on Stack Overflow about what I'm trying to do, but figure I might get a better response here.

Basically, I want to set up UseMin so instead of building this:

<script src="scripts/b7197f7b.main.js"></script>

it builds this:

<script src="www.my-cdn-url.com/scripts/b7197f7b.main.js"></script>

Now, I've almost accomplished this with a blockReplacement like so:

usemin: {
    html: ['<%= yeoman.dist %>/{,*/}*.html'],
    css: ['<%= yeoman.dist %>/styles/{,*/}*.css'],
    options: {
        dirs: ['<%= yeoman.dist %>'],
        blockReplacements: {
            js: function (block) {
                return '<script type="text/javascript" src="www.my-cdn-url.com/scripts/'+block.dest+'"></script>';
            }
        }
    }
},

but the problem here is the revisioning number is getting dropped. I am using grunt-rev to produce a version number on my builds.

// desired output:
<script src="www.my-cdn-url.com/scripts/b7197f7b.main.js"></script>

// actual output:
<script src="www.my-cdn-url.com/scripts/main.js"></script>

Hope I've made myself clear --- is there a way to do what I'm trying to accomplish?

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

No branches or pull requests

1 participant