Skip to content

Instantly share code, notes, and snippets.

@stephenplusplus
Created May 12, 2016 18:33
Show Gist options
  • Select an option

  • Save stephenplusplus/05649c7946fac9818cab6a805ad45443 to your computer and use it in GitHub Desktop.

Select an option

Save stephenplusplus/05649c7946fac9818cab6a805ad45443 to your computer and use it in GitHub Desktop.
{
"name": "play-1463077577",
"main": "index.js",
"version": "0.0.0",
"authors": [
"Stephen Sawchuk <sawchuk@gmail.com>"
],
"description": "",
"moduleType": [],
"license": "MIT",
"homepage": "",
"ignore": [
"**/.*",
"node_modules",
"bower_components",
"test",
"tests"
],
"dependencies": {
"jquery": "~2.2.3"
}
}
<!-- bower:js -->
<!-- endbower -->
'use strict'
var fs = require('fs')
var wiredep = require('wiredep')
wiredep({
src: './index.html',
fileTypes: {
html: {
replace: {
js: function(filePath) {
var fileIsMinified = filePath.indexOf('min.js') > -1
if (!fileIsMinified) {
var possibleMinFilePath = filePath.replace('.js', '.min.js')
if (fs.existsSync(possibleMinFilePath)) {
filePath = possibleMinFilePath
}
}
return '<script src="' + filePath + '"></script>'
}
}
}
}
})
{
"name": "play-1463077577",
"version": "0.0.0",
"description": "",
"main": "index.js",
"keywords": [],
"author": "Stephen Sawchuk <sawchuk@gmail.com>",
"license": "MIT",
"dependencies": {
"wiredep": "^4.0.0"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment