[TASK] Seperate dev and default for requirejs

This commit is contained in:
Xaver Maierhofer 2016-05-23 00:13:21 +02:00 committed by Milan Pässler
parent 5921a5f355
commit e9e393e105
4 changed files with 22 additions and 7 deletions

View file

@ -1,8 +1,9 @@
module.exports = function (grunt) { module.exports = function (grunt) {
grunt.loadTasks("tasks"); 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("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"]);
}; };

View file

@ -46,6 +46,10 @@ Just run the following command from the hopglass directory:
This will generate `build/` containing all required files. This will generate `build/` containing all required files.
## Development
Use `grunt serve` for development.
# Configure # Configure
Copy `config.json.example` to `build/config.json` and change it to match your community. Copy `config.json.example` to `build/config.json` and change it to match your community.

View file

@ -109,15 +109,25 @@ module.exports = function (grunt) {
} }
}, },
requirejs: { requirejs: {
compile: { default: {
options: { options: {
baseUrl: "lib", baseUrl: "lib",
name: "../bower_components/almond/almond", name: "../bower_components/almond/almond",
mainConfigFile: "app.js", mainConfigFile: "app.js",
include: "../app", include: "../app",
wrap: true, out: "build/app.js",
optimize: "uglify", build: false
out: "build/app.js" }
},
dev: {
options: {
baseUrl: "lib",
name: "../bower_components/almond/almond",
mainConfigFile: "app.js",
include: "../app",
optimize: "none",
out: "build/app.js",
build: false
} }
} }
} }

View file

@ -19,7 +19,7 @@ module.exports = function (grunt) {
livereload: true livereload: true
}, },
files: ["*.css", "app.js", "lib/**/*.js", "*.html"], files: ["*.css", "app.js", "lib/**/*.js", "*.html"],
tasks: ["default"] tasks: ["dev"]
}, },
config: { config: {
options: { options: {