0
0
mirror of https://github.com/Doodle3D/doodle3d-connect.git synced 2024-12-25 01:53:48 +01:00
This commit is contained in:
peteruithoven 2014-04-24 12:14:25 +02:00
parent f247f1b3dc
commit 8a7587f878
3 changed files with 192 additions and 0 deletions

2
.gitignore vendored
View File

@ -4,3 +4,5 @@ credentials.php
!/.gitignore !/.gitignore
www/js/*.js www/js/*.js
www/css/*.css www/css/*.css
node_modules/*
www/css/images/**

171
Gruntfile.js Normal file
View File

@ -0,0 +1,171 @@
/*global module:false*/
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
// Metadata.
pkg: grunt.file.readJSON('package.json'),
banner: '/*! <%= pkg.title || pkg.name %> - v<%= pkg.version %> - ' +
'<%= grunt.template.today("yyyy-mm-dd") %>\n' +
'<%= pkg.homepage ? "* " + pkg.homepage + "\\n" : "" %>' +
'* Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>;' +
' Licensed <%= _.pluck(pkg.licenses, "type").join(", ") %> */\n',
less: {
development: {
src: "less/*.less",
dest: ".tmp/<%= pkg.name %>.css"
}
},
concat: {
js: {
src: [
'js/libs/jquery-1.11.0.min.js', // make sure it's first
'js/libs/*.js',
'js/libs/jquery.mobile/*.min.js',
'js/api/*.js',
'js/*.js',
// make sure we put main.js last
'!js/main.js',
'js/main.js',
],
dest: 'www/js/<%= pkg.name %>.js'
},
less: {
src: [
'js/libs/jquery.mobile/jquery.mobile-1.4.2.css',
'less/*.css',
'.tmp/<%= pkg.name %>.css'
],
dest: 'www/css/<%= pkg.name %>.css' /* to css so it's replaced */
}
},
autoprefixer: {
options: {
browsers: ['> 1%', 'last 2 versions', 'ie 8', 'ie 9', 'ff 17', 'opera 12.1']
},
// prefix all specified files and save them separately
single_file: {
options: {},
// expand: true,
// flatten: true,
src: 'www/css/<%= pkg.name %>.css',
dest: 'www/css/<%= pkg.name %>.css'
}
},
cssmin: {
minify: {
expand: true,
cwd: 'www/css/',
src: ['*.css', '!*.min.css'],
dest: 'www/css/',
ext: '.min.css'
}
},
uglify: {
options: {
// banner: '/*! <%= pkg.name %> <%= grunt.template.today("yyyy-mm-dd") %> */\n',
mangle: true,
beautify: false,
compress: {},
// report: 'min',
preserveComments: 'some'
},
js: {
files: {
'www/js/<%= pkg.name %>.min.js' : ['www/js/<%= pkg.name %>.js']
}
},
/*jslibs: {
cwd: "js/libs/",
// src: ['js/libs/*.js', '!js/libs/*.min.js'], // source files mask
src: ['*.js', '!*.min.js'], // source files mask
dest: 'www/js/libs/', // destination folder
expand: true, // allow dynamic building
flatten: true, // remove all unnecessary nesting
ext: '.min.js' // replace .js to .min.js
// files: {
// 'www/js/<%= pkg.name %>.min.js' : ['www/js/<%= pkg.name %>.js']
// }
}*/
},
jshint: {
options: {
globals: {
jQuery: true,
$: true,
console: false,
d3d: true,
ConnectAPI: true,
NetworkAPI: true
},
browser: true,
curly: true,
eqeqeq: true,
immed: true,
latedef: true,
newcap: true,
noarg: true,
sub: true,
undef: true,
unused: false,
boss: true,
eqnull: true
},
// gruntfile: {
// src: 'Gruntfile.js'
// },
// lib_test: {
// src: ['www/js/*.js', '!www/js/<%= pkg.name %>.js', '!www/js/<%= pkg.name %>.min.js']
// }
src: ['js/**.js'],
},
copy: {
main: {
expand: true,
nonull: true,
cwd: "js/libs/jquery.mobile/images/",
src: "**",
dest: "www/css/images/"
}
},
watch: {
javascript: {
files: ["js/**", '!www/js/<%= pkg.name %>.min.js', '!www/js/<%= pkg.name %>.js'],
tasks: ["concat:js", "uglify:js"]
// tasks: ["jshint", "concat", "uglify"]
},
// javascriptLibs: {
// files: ["js/libs/*"],
// tasks: ["uglify:jslibs"]
//// tasks: ["jshint", "concat", "uglify"]
// },
styles: {
files: ["less/*"],
tasks: ["concat:less", "less", "autoprefixer", "cssmin"]
}
},
});
// These plugins provide necessary tasks.
grunt.loadNpmTasks('grunt-contrib-less');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-autoprefixer');
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.loadNpmTasks('grunt-contrib-copy');
// Default task.
grunt.registerTask('default', [
'less',
'autoprefixer',
'concat',
'cssmin',
'uglify',
'jshint',
'copy',
'watch'
]);
};

19
package.json Normal file
View File

@ -0,0 +1,19 @@
{
"name": "doodle3d-server",
"version": "0.9.0",
"description": "Doodle3D Connect server",
"author": "Peter Uithoven, Rick Companje",
"readmeFilename": "README.md",
"devDependencies": {
"grunt": "~0.4.1",
"grunt-cli": "~0.1.9",
"grunt-contrib-less": "~0.7.0",
"grunt-contrib-watch": "~0.5.3",
"grunt-contrib-uglify": "~0.2.4",
"grunt-contrib-jshint": "~0.6.4",
"grunt-autoprefixer": "~0.4.0",
"grunt-contrib-cssmin": "~0.6.2",
"grunt-contrib-concat": "~0.3.0",
"grunt-contrib-copy": "~0.5.0"
}
}