-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
405 additions
and
469 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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
presets: ["es2015"] | ||
} |
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 was deleted.
Oops, something went wrong.
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 +1,79 @@ | ||
# my webapp template | ||
# Micua Home | ||
|
||
## Install | ||
npm i browser-sync del gulp gulp-autoprefixer gulp-cache gulp-eslint gulp-gh-pages gulp-if gulp-imagemin gulp-load-plugins gulp-minify-css gulp-minify-html gulp-plumber gulp-sass gulp-size gulp-sourcemaps gulp-uglify gulp-useref main-bower-files wiredep | ||
|
||
gulp babel | ||
|
||
babel-core | ||
babel-preset-es2015 | ||
|
||
|
||
var fs = require('fs'); | ||
var path = require('path'); | ||
var crypto = require('crypto'); | ||
var Buffer = require('buffer').Buffer; | ||
var gutil = require('gulp-util'); | ||
var PluginError = gutil.PluginError; | ||
var map = require('event-stream').map; | ||
|
||
var FILE_DECL = /(href=|src=|url\()(['|"])([^\s>"'.]+?(\.css|\.js|\.png|\.gif|\.jpeg|\.jpg))(['|"])/gi; | ||
|
||
var revPlugin = function revPlugin() { | ||
|
||
return map(function(file, cb) { | ||
|
||
var contents; | ||
var lines; | ||
var i, length; | ||
var line; | ||
var groups; | ||
var dependencyPath; | ||
var data, hash; | ||
|
||
if (!file) { | ||
throw new PluginError('gulp-rev-append', 'Missing file option for gulp-rev-append.'); | ||
} | ||
|
||
if (!file.contents) { | ||
throw new PluginError('gulp-rev-append', 'Missing file.contents required for modifying files using gulp-rev-append.'); | ||
} | ||
|
||
contents = file.contents.toString(); | ||
lines = contents.split('\n'); | ||
length = lines.length; | ||
|
||
for (i = 0; i < length; i++) { | ||
line = lines[i]; | ||
groups = FILE_DECL.exec(line); | ||
if (groups && groups.length > 1) { | ||
// are we an "absoulte path"? (e.g. /js/app.js) | ||
var normPath = path.normalize(groups[3]); | ||
if (normPath.indexOf(path.sep) === 0) { | ||
dependencyPath = path.join(file.base, normPath); | ||
} else { | ||
dependencyPath = path.resolve(path.dirname(file.path), normPath); | ||
} | ||
|
||
try { | ||
data = fs.readFileSync(dependencyPath); | ||
hash = crypto.createHash('md5'); | ||
hash.update(data.toString(), 'utf8'); | ||
line = line.replace(groups[4], groups[4] + '?v=' + hash.digest('hex')); | ||
console.log(line); | ||
} catch (e) { | ||
// fail silently. | ||
console.log(e); | ||
} | ||
} | ||
lines[i] = line; | ||
FILE_DECL.lastIndex = 0; | ||
} | ||
file.contents = new Buffer(lines.join('\n')); | ||
cb(null, file); | ||
|
||
}); | ||
|
||
}; | ||
|
||
module.exports = revPlugin; |
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,33 +1,32 @@ | ||
{ | ||
"name": "micua", | ||
"private": true, | ||
"dependencies": { | ||
"bootstrap": "~4.0.0", | ||
"font-awesome": "fontawesome#~4.4.0", | ||
"modernizr": "~2.8.3" | ||
"name": "micua", | ||
"private": true, | ||
"dependencies": { | ||
"bootstrap": "~4.0.0", | ||
"modernizr": "~2.8.3" | ||
}, | ||
"devDependencies": { | ||
"chai": "~3.2.0", | ||
"mocha": "~2.2.5" | ||
}, | ||
"overrides": { | ||
"bootstrap": { | ||
"main": [ | ||
"scss/bootstrap.scss", | ||
"dist/js/bootstrap.js" | ||
] | ||
}, | ||
"devDependencies": { | ||
"chai": "~3.2.0", | ||
"mocha": "~2.2.5" | ||
}, | ||
"overrides": { | ||
"bootstrap":{ | ||
"main":[ | ||
"scss/bootstrap.scss", | ||
"dist/js/bootstrap.js" | ||
] | ||
}, | ||
"font-awesome":{ | ||
"main": [ | ||
"less/font-awesome.less", | ||
"scss/font-awesome.scss", | ||
"fonts/fontawesome-webfont.eot", | ||
"fonts/fontawesome-webfont.svg", | ||
"fonts/fontawesome-webfont.ttf", | ||
"fonts/fontawesome-webfont.woff", | ||
"fonts/fontawesome-webfont.woff2", | ||
"fonts/FontAwesome.otf" | ||
] | ||
} | ||
"font-awesome": { | ||
"main": [ | ||
"less/font-awesome.less", | ||
"scss/font-awesome.scss", | ||
"fonts/fontawesome-webfont.eot", | ||
"fonts/fontawesome-webfont.svg", | ||
"fonts/fontawesome-webfont.ttf", | ||
"fonts/fontawesome-webfont.woff", | ||
"fonts/fontawesome-webfont.woff2", | ||
"fonts/FontAwesome.otf" | ||
] | ||
} | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.