Initialize repository
This commit is contained in:
parent
ba75171cc8
commit
94e867874b
83
Gruntfile.js
Normal file
83
Gruntfile.js
Normal file
@ -0,0 +1,83 @@
|
||||
var path = require('path'),
|
||||
fs = require('fs');
|
||||
|
||||
module.exports = function(grunt) {
|
||||
grunt.initConfig({
|
||||
less: {
|
||||
development: {
|
||||
files: [{
|
||||
src: 'less/main.less',
|
||||
dest: 'style.css'
|
||||
}]
|
||||
},
|
||||
production: {
|
||||
options: {
|
||||
plugins: require('less-plugin-clean-css')()
|
||||
},
|
||||
files: [{
|
||||
src: 'less/main.less',
|
||||
dest: 'style.css'
|
||||
}]
|
||||
}
|
||||
},
|
||||
uglify: {
|
||||
production: {
|
||||
files: {
|
||||
'main.js': 'js/**/*.js'
|
||||
}
|
||||
}
|
||||
},
|
||||
injector: {
|
||||
options: {
|
||||
transform: function(file) {
|
||||
var ext = path.extname(file).slice(1);
|
||||
|
||||
switch (ext) {
|
||||
case 'css':
|
||||
return '<link rel="stylesheet" href="' + file + '" />';
|
||||
case 'js':
|
||||
return '<script src="' + file + '"></script>';
|
||||
case 'html':
|
||||
return fs.readFileSync(__dirname + file);
|
||||
}
|
||||
}
|
||||
},
|
||||
development: {
|
||||
files: {
|
||||
'index.html': ['js/libs/*.js', 'js/*.js',
|
||||
'style.css', 'partials/**/*.html'],
|
||||
'how.html': ['js/libs/*.js', 'js/*.js',
|
||||
'style.css', 'partials/0-header.html',
|
||||
'partials/how*.html']
|
||||
}
|
||||
},
|
||||
production: {
|
||||
files: {
|
||||
'index.html': ['main.js', 'style.css', 'partials/**/*.html'],
|
||||
'how.html': ['main.js', 'style.css',
|
||||
'partials/0-header.html', 'partials/how*.html']
|
||||
}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
styles: {
|
||||
files: ['less/**/*.less'],
|
||||
tasks: ['less']
|
||||
},
|
||||
partials: {
|
||||
files: ['partials/**/*.html'],
|
||||
tasks: ['injector']
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
grunt.loadNpmTasks('grunt-contrib-less');
|
||||
grunt.loadNpmTasks('grunt-contrib-watch');
|
||||
grunt.loadNpmTasks('grunt-contrib-uglify');
|
||||
grunt.loadNpmTasks('grunt-asset-injector');
|
||||
|
||||
grunt.registerTask('default', ['less:development', 'injector:development']);
|
||||
grunt.registerTask('production', ['less:production',
|
||||
'uglify:production',
|
||||
'injector:production']);
|
||||
};
|
40
package.json
Normal file
40
package.json
Normal file
@ -0,0 +1,40 @@
|
||||
{
|
||||
"name": "",
|
||||
"version": "0.1.0",
|
||||
"description": "",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"test": "grunt test"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/mdibaiee/"
|
||||
},
|
||||
"keywords": [],
|
||||
"author": "Mahdi Dibaiee",
|
||||
"license": "MIT",
|
||||
"bugs": {
|
||||
"url": "https://github.com/mdibaiee//issues"
|
||||
},
|
||||
"files": [
|
||||
"types",
|
||||
"build",
|
||||
"index.js"
|
||||
],
|
||||
"directories": {
|
||||
"lib": "lib"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.12.0"
|
||||
},
|
||||
"homepage": "https://github.com/mdibaiee/",
|
||||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
"grunt": "^0.4.5",
|
||||
"grunt-asset-injector": "^0.1.0",
|
||||
"grunt-contrib-less": "^1.0.1",
|
||||
"grunt-contrib-uglify": "^0.9.2",
|
||||
"grunt-contrib-watch": "^0.6.1",
|
||||
"less-plugin-clean-css": "^1.5.1"
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user