[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) { 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

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