From 231bfcedd7ef065b5ef83d08d67877e8b6787eb9 Mon Sep 17 00:00:00 2001 From: Xaver Maierhofer Date: Mon, 23 May 2016 00:13:21 +0200 Subject: [PATCH] [TASK] Seperate dev and default for requirejs --- Gruntfile.js | 5 +++-- README.md | 4 ++++ tasks/build.js | 18 ++++++++++++++---- tasks/development.js | 2 +- 4 files changed, 22 insertions(+), 7 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index 2c15b33..99fcd04 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -1,8 +1,9 @@ module.exports = function (grunt) { grunt.loadTasks("tasks"); - grunt.registerTask("default", ["bower-install-simple", "lint", "copy", "sass", "postcss", "requirejs", "inline"]); + grunt.registerTask("default", ["bower-install-simple", "lint", "copy", "sass", "postcss", "requirejs:default", "inline"]); grunt.registerTask("lint", ["eslint"]); - grunt.registerTask("dev", ["default", "connect:server", "watch"]); + grunt.registerTask("dev", ["bower-install-simple", "lint", "copy", "sass", "requirejs:dev"]); + grunt.registerTask("serve", ["dev", "connect:server", "watch"]); }; diff --git a/README.md b/README.md index ae7bba7..4a15dbc 100644 --- a/README.md +++ b/README.md @@ -46,6 +46,10 @@ Just run the following command from the hopglass directory: This will generate `build/` containing all required files. +## Development + +Use `grunt serve` for development. + # Configure Copy `config.json.example` to `build/config.json` and change it to match your community. diff --git a/tasks/build.js b/tasks/build.js index 54cad5a..9c62838 100644 --- a/tasks/build.js +++ b/tasks/build.js @@ -109,15 +109,25 @@ module.exports = function (grunt) { } }, requirejs: { - compile: { + default: { options: { baseUrl: "lib", name: "../bower_components/almond/almond", mainConfigFile: "app.js", include: "../app", - wrap: true, - optimize: "uglify", - out: "build/app.js" + out: "build/app.js", + build: false + } + }, + dev: { + options: { + baseUrl: "lib", + name: "../bower_components/almond/almond", + mainConfigFile: "app.js", + include: "../app", + optimize: "none", + out: "build/app.js", + build: false } } } diff --git a/tasks/development.js b/tasks/development.js index 3ae384e..02826b0 100644 --- a/tasks/development.js +++ b/tasks/development.js @@ -19,7 +19,7 @@ module.exports = function (grunt) { livereload: true }, files: ["*.css", "app.js", "lib/**/*.js", "*.html"], - tasks: ["default"] + tasks: ["dev"] }, config: { options: {