From 95dfe14528663923ca2a88ec928f1d8d9df2402b Mon Sep 17 00:00:00 2001 From: bai Date: Fri, 29 Mar 2019 02:14:43 +0000 Subject: Init --- static/js/wpaint/gruntfile.js | 90 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 90 insertions(+) create mode 100644 static/js/wpaint/gruntfile.js (limited to 'static/js/wpaint/gruntfile.js') diff --git a/static/js/wpaint/gruntfile.js b/static/js/wpaint/gruntfile.js new file mode 100644 index 0000000..4e1eb06 --- /dev/null +++ b/static/js/wpaint/gruntfile.js @@ -0,0 +1,90 @@ +module.exports = function(grunt) { + grunt.initConfig({ + pkg: grunt.file.readJSON('package.json'), + jshint: { + options: { + bitwise: true, + camelcase: true, + indent: 2, + curly: true, + eqeqeq: true, + immed: true, + latedef: true, + newcap: true, + noarg: true, + sub: true, + undef: true, + unused: true, + boss: true, + eqnull: true, + white: true, + validthis: true, + quotmark: 'single', + globals: { + 'window': true, + 'jQuery': true, + 'document': true, + 'Image': true, + 'setTimeout': true, + 'clearTimeout': true, + 'event': true, + 'CanvasRenderingContext2D': true + } + }, + files: { + src: ['./plugins/**/src/wPaint-*.js', './src/*.js'] + } + }, + uglify: { + options: { + banner: '/*! <%= pkg.name %> - v<%= pkg.version %> - <%= grunt.template.today("yyyy-mm-dd") %> */' + }, + my_target: { + files: { + './wPaint.min.js': ['./src/wPaint.js', './src/wPaint.utils.js'], + './plugins/main/wPaint.menu.main.min.js': ['./plugins/main/src/wPaint.menu.main.js', './plugins/main/src/fillArea.min.js'], + './plugins/text/wPaint.menu.text.min.js': ['./plugins/text/src/wPaint.menu.text.js'], + './plugins/shapes/wPaint.menu.main.shapes.min.js': ['./plugins/shapes/src/wPaint.menu.main.shapes.js', './plugins/shapes/src/shapes.min.js'], + './plugins/file/wPaint.menu.main.file.min.js': ['./plugins/file/src/wPaint.menu.main.file.js'] + } + } + }, + stylus: { + compile: { + options: { + import: ['nib', '../lib/mixins'], + }, + files: { + './wPaint.min.css': './src/wPaint.css' + } + } + }, + concat: { + basic_and_extras: { + files: { + 'wPaint-min.js': ['./lib/wColorPicker.min.js', './wPaint.min.js'], + 'wPaint-min.css': ['./lib/wColorPicker.min.css', './wPaint.min.css'], + }, + } + }, + watch: { + files: [ + './src/wPaint.css', + './src/wPaint.js', + './plugins/file/src/wPaint.menu.main.js', + './plugins/file/src/wPaint.menu.text.js', + './plugins/file/src/wPaint.menu.main.shapes.js', + './plugins/file/src/wPaint.menu.main.file.js' + ], + tasks: ['uglify'] + } + }); + + grunt.loadNpmTasks('grunt-contrib-watch'); + grunt.loadNpmTasks('grunt-contrib-stylus'); + grunt.loadNpmTasks('grunt-contrib-jshint'); + grunt.loadNpmTasks('grunt-contrib-uglify'); + grunt.loadNpmTasks('grunt-contrib-concat'); + + grunt.registerTask('default', ['jshint', 'stylus', 'uglify']); +}; \ No newline at end of file -- cgit v1.2.1-18-gbd029