[TASK] Seperate dev and default for requirejs

This commit is contained in:
Xaver Maierhofer 2016-05-23 00:13:21 +02:00
parent 63dc066499
commit d5354e0261
4 changed files with 22 additions and 7 deletions

View File

@ -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"]);
};

View File

@ -44,6 +44,10 @@ Just run the following command from the meshviewer 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.

View File

@ -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
}
}
}

View File

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