Closed pencilcheck closed 6 years ago
I have no idea. That is not enough information for me to understand what's going on. Try to create a minimal test-case that replicates the issue and provide all the code involved (it should only require a couple lines of gulp and few lines of HTML).
https://github.com/pencilcheck/cdnizer-test-case
Here is a minimal test case, a scaffold from yeoman using gulp build system, angular and angular material.
If you do a git pull
and run bower install
and npm install
on the root project root. Then run gulp watch
then C-c
to stop the process, open the index.html under .tmp/serve/
folder, you should notice that some angular script tags are being replaced with the cdnizer with the problem described above.
If you want to play with cdnizer, go to gulp/inject.js
at around line 32
The project is using gulp-cdnizer
for the gulp integration btw.
I'm sorry, that is not a minimal test case. A minimal case should have at most 3 files: gulpfile.js
, package.json
, and index.html
.
I really don't have the time to go through an entire scaffolded application to understand what's going on.
https://github.com/pencilcheck/cdnizer-test-case
OK, I have help you to remove all unnecessary files. I have tried very hard to make it as minimal as possible, now there is only gulpfile.js and simple package.json and bower.json left. Just run npm install
then bower install
then run gulp
to produce a index.html in the root folder that has the problem.
OK, it turns out it's related to the allowRev
property, which is by default set to true
. Just change your config to be something like this to fix the issue:
{
allowRev: false,
files: [ 'google:angular' ]
}
It's probably something that needs to be corrected, but it would be a breaking change, and I don't have the time to fix it at this moment.
What does allowRev do?
Version 2.0 changes the default behavior moving forward, so allowRev
defaults to false
.
Some angular files are replaced with the wrong cdn files:
bower_components/angular-sanitize/angular-sanitize.js bower_components/angular-messages/angular-messages.js are being replaced with angular.min.js
when I use 'google:angular' in the options or 'jsdelivr:angularjs' the following files:
bower_components/angular-sanitize/angular-sanitize.js bower_components/angular-messages/angular-messages.js bower_components/angular-material/angular-material.js will be replaced with angular.min.js