Permalink
Browse files

grunt serve added, time grunt issue solved

  • Loading branch information...
1 parent fa1f5de commit 7e661ffc6838d66d64a312e89c98c44967cb6a27 @douglasdeodato douglasdeodato committed Sep 26, 2016
Showing with 70 additions and 58 deletions.
  1. +65 −55 Gruntfile.js
  2. +5 −3 package.json
View
@@ -1,69 +1,79 @@
- module.exports = function (grunt) {
- var config = {};
+module.exports = function(grunt) {
+ var config = {};
- //src ===============================
- var src;
- config.src = src = {
- sassMain : 'scss/multi-select.scss',
- distFolder : 'css/multi-select.dist.css',
- devFolder : 'css/multi-select.dev.css',
- sassFolder : 'scss/**/*.scss',
-
- };
+ //src ===============================
+ var src;
+ config.src = src = {
+ sassMain: 'scss/multi-select.scss',
+ distFolder: 'css/multi-select.dist.css',
+ devFolder: 'css/multi-select.dev.css',
+ sassFolder: 'scss/**/*.scss',
+ serverPort: 8000
+ };
- //Watch ===============================
- config.watch = {
- scripts: {
- files: ["<%= src.libFolder %>", "<%= src.sassFolder %>"]
- ,tasks: ["dev", "sass:dist"]
- //,tasks: ["dev",'sass:dist']
- }
- }
+ //Watch ===============================
+ config.watch = {
+ scripts: {
+ files: ["<%= src.sassFolder %>"],
+ tasks: ["dev", "sass:dist"]
+ //,tasks: ["dev",'sass:dist']
+ }
+ }
- //Sass ===============================
- var sass;
- config.sass = sass = {};
- //distribution
- sass.dist = {
- options: {
- style: "compressed",
- noCache: true,
- sourcemap: 'none',
- update:true
- }
- , files: {
- "<%= src.distFolder %>" : "<%= src.sassMain %>"
- }
- };
+ //Sass ===============================
+ var sass;
+ config.sass = sass = {};
- //development env.
- sass.dev = {
- options: {
- style: "expanded",
- lineNumber: true,
- }
- , files: {
- "<%= src.devFolder %>" : "<%= src.sassMain %>"
- }
- };
+ //distribution
+ sass.dist = {
+ options: {
+ style: "compressed",
+ noCache: true,
+ sourcemap: 'none',
+ update: true
+ },
+ files: {
+ "<%= src.distFolder %>": "<%= src.sassMain %>"
+ }
+ };
+ //development env.
+ sass.dev = {
+ options: {
+ style: "expanded",
+ lineNumber: true,
+ },
+ files: {
+ "<%= src.devFolder %>": "<%= src.sassMain %>"
+ }
+ };
-
- //Register custom tasks ===============================
- grunt.registerTask('default',['dev']);
- grunt.registerTask('dev', ['sass:dev']);
- grunt.registerTask('dist',['sass:dist']);
- require('time-grunt')(grunt);
- require('load-grunt-tasks')(grunt, {
- scope: 'devDependencies'
- });
+ //grunt serve ===============================
+ config.connect = {
+ server: {
+ options: {
+ livereload: true,
+ port: "<%= src.serverPort %>"
+ }
+ }
+ };
+ //Register custom tasks ===============================
+ grunt.registerTask('default', ['dev']);
+ grunt.registerTask('dev', ['sass:dev']);
+ grunt.registerTask('dist', ['sass:dist']);
+ grunt.registerTask('serve', ['connect:server', 'watch']);
+ require('time-grunt')(grunt);
+ require('load-grunt-tasks')(grunt, {
+ scope: 'devDependencies'
+ });
- //General setup ===============================
- grunt.initConfig(config);
+
+ //General setup ===============================
+ grunt.initConfig(config);
};
View
@@ -11,7 +11,7 @@
},
"repository": {
"type": "git",
- "url": "git+https://github.com/douglasdeodato/multi-select.git"
+ "url": "git+https://github.com/lou/multi-select.git"
},
"author": "",
"license": "WTFPL",
@@ -23,7 +23,9 @@
"load-grunt-tasks": "^3.5.0",
"time-grunt": "^1.3.0",
"grunt-contrib-sass": "*",
- "grunt-contrib-watch": "*"
+ "grunt-contrib-watch": "*",
+ "time-grunt": "^1.3.0",
+ "grunt-contrib-connect": "^1.0.2"
},
- "homepage": "https://github.com/douglasdeodato/multi-select#readme"
+ "homepage": "https://github.com/lou/multi-select#README.markdown"
}

0 comments on commit 7e661ff

Please sign in to comment.