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

Cannot see any cdn script in the dist/public/index.html file. #1138

Closed
chenweiyj opened this issue Aug 7, 2015 · 4 comments
Closed

Cannot see any cdn script in the dist/public/index.html file. #1138

chenweiyj opened this issue Aug 7, 2015 · 4 comments

Comments

@chenweiyj
Copy link

I run grunt and it tells me the following output.

Running "cdnify:dist" (cdnify) task
Going through dist/public/index.html to update script refs
✔ bower_components/angular/angular.js changed to //ajax.googleapis.com/ajax/libs/angularjs/1.4.0-beta.2/angular.min.js
✔ bower_components/angular-cookies/angular-cookies.js changed to //ajax.googleapis.com/ajax/libs/angularjs/1.4.0-beta.2/angular-cookies.min.js
✔ bower_components/angular-resource/angular-resource.js changed to //ajax.googleapis.com/ajax/libs/angularjs/1.4.0-beta.2/angular-resource.min.js
✔ bower_components/angular-sanitize/angular-sanitize.js changed to //ajax.googleapis.com/ajax/libs/angularjs/1.4.0-beta.2/angular-sanitize.min.js

However I cannot find any cdn script shown in the dist/public/index.html.

@kingcody
Copy link
Member

kingcody commented Aug 7, 2015

@Awk34
Copy link
Member

Awk34 commented Sep 13, 2015

Closed due to inactivity.

@Awk34 Awk34 closed this as completed Sep 13, 2015
@david-mohr
Copy link
Contributor

I came across this when working on a cdnify task for gulp. Do the maintainers have a stance on how this should work?

My personal opinion is that as a user, if you're calling cdnify, then you don't want any of the CDN links to be bundled into the vendor.js file. The solution is to move/hoist and CDN links above the <!-- build section.

For Grunt, the option is https://github.com/mjetek/grunt-cdn-nobuild.

And I've ported this to gulp: https://github.com/david-mohr/gulp-cdn-hoist

Also, during my testing I noticed something that might prevent this from working as expected: jquery doesn't appear in bower.json. Consequently it won't be caught by cdnify but angular will, meaning that angular will appear before jquery in index.html and therefore angular may not behave as expected.

@jkiimm
Copy link
Contributor

jkiimm commented Jan 14, 2016

I'm running into this problem too. So, I've found that grunt-usemin owner commented to use block replacement for ignoring CDN resources in their issue.

Would that be alternative option to use filter with regex that figures out whether is CDN resource or not in blockReplacement?

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