-
Notifications
You must be signed in to change notification settings - Fork 101
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* adding option cdnPath from Version 0.4.12 since updates from 1.5.0 break the desired behavior on asset-files uploaded to cdn * renaming cdnPath to urlPrefixes and changed it to Array of Strings * updating travis to currently maintained versions of nodejs
- Loading branch information
1 parent
4e3561a
commit 7845750
Showing
12 changed files
with
78 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,8 @@ | ||
language: node_js | ||
sudo: false | ||
node_js: | ||
- "7" | ||
- "10" | ||
- "8" | ||
- "6" | ||
- "5" | ||
- "4" | ||
before_script: | ||
- npm install -g grunt-cli |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
module.exports = { | ||
options: { | ||
assets: ['**/*.{css,jpg}'], | ||
baseDir: 'tmp/urlPrefixes', | ||
urlPrefixes: ['http://owncdn1.test.com/path', 'http://owncdn2.test.com/path'], | ||
deleteOriginals: true, | ||
hash: '123456789' | ||
}, | ||
files: [{ | ||
expand: true, | ||
cwd: 'tmp/urlPrefixes', | ||
src: ['css/*.css', '*.html'] | ||
}] | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
body { | ||
background-color: red; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>Realpath example</title> | ||
<link rel="stylesheet" type="text/css" href="/css/app.css"> | ||
<link rel="stylesheet" type="text/css" href="http://owncdn1.test.com/path/css/app.css"> | ||
</head> | ||
<body> | ||
<img src="http://owncdn1.test.com/path/assets/imgsrcset.jpg" srcset="http://owncdn2.test.com/path/assets/imgsrcset-small.jpg 400w, http://owncdn1.test.com/path/assets/imgsrcset-big.jpg 900w" alt="img srcset with urlPrefix example"> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
'use strict'; | ||
|
||
var grunt = require('grunt'); | ||
|
||
module.exports = { | ||
|
||
urlPrefixes: function(test) { | ||
var markup = grunt.file.read('tmp/urlPrefixes/urlPrefixes.html'); | ||
|
||
test.ok(markup.match(/\/css\/app\.123456789\.css\"/), 'testing /css/app.css replaced'); | ||
test.ok(markup.match(/http:\/\/owncdn1\.test\.com\/path\/css\/app\.123456789\.css\"/), 'testing http://owncdn1.test.com/path/css/app.css replaced'); | ||
|
||
test.ok(markup.match(/http:\/\/owncdn1\.test\.com\/path\/assets\/imgsrcset\.123456789\.jpg/), 'testing srcset assets/imgsrcset.jpg'); | ||
test.ok(markup.match(/http:\/\/owncdn1\.test\.com\/path\/assets\/imgsrcset-big\.123456789\.jpg/), 'testing srcset assets/imgsrcset-big.jpg'); | ||
test.ok(markup.match(/http:\/\/owncdn2\.test\.com\/path\/assets\/imgsrcset-small\.123456789\.jpg/), 'testing srcset assets/imgsrcset-small.jpg'); | ||
|
||
test.done(); | ||
} | ||
|
||
}; |