[TASK] Development sourcemap and release clean

- Add app.js sourcemap for development
- Remove css sourcemap in release
- Clean build folder for release
This commit is contained in:
Xaver Maierhofer 2016-06-03 00:49:45 +02:00
parent 4692413b52
commit 3422063ac3
3 changed files with 15 additions and 5 deletions

View File

@ -3,7 +3,7 @@ module.exports = function (grunt) {
grunt.loadTasks("tasks"); grunt.loadTasks("tasks");
grunt.registerTask("default", ["bower-install-simple", "lint", "copy", "sass", "postcss", "requirejs:default", "inlinedata", "cachebreaker", "inline"]); grunt.registerTask("default", ["bower-install-simple", "lint", "copy", "sass:dist", "postcss", "requirejs:default", "inlinedata", "cachebreaker", "inline", "clean:release"]);
grunt.registerTask("lint", ["sasslint", "eslint"]); grunt.registerTask("lint", ["sasslint", "eslint"]);
grunt.registerTask("serve", ["bower-install-simple", "lint", "copy", "sass", "requirejs:dev", "inlinedata", "browserSync", "watch"]); grunt.registerTask("serve", ["bower-install-simple", "lint", "copy", "sass:dev", "requirejs:dev", "inlinedata", "browserSync", "watch"]);
}; };

View File

@ -48,11 +48,19 @@ module.exports = function (grunt) {
} }
}, },
sass: { sass: {
dev: {
options: { options: {
sourceMap: true, sourceMap: true,
outputStyle: "compressed" outputStyle: "expanded"
},
files: {
"build/style.css": "scss/main.scss"
}
}, },
dist: { dist: {
options: {
outputStyle: "compressed"
},
files: { files: {
"build/style.css": "scss/main.scss" "build/style.css": "scss/main.scss"
} }
@ -121,7 +129,8 @@ module.exports = function (grunt) {
include: "../app", include: "../app",
optimize: "none", optimize: "none",
out: "build/app.js", out: "build/app.js",
build: false build: false,
generateSourceMaps: true
} }
} }
}, },

View File

@ -3,7 +3,8 @@ module.exports = function (grunt) {
grunt.config.merge({ grunt.config.merge({
clean: { clean: {
build: ["build/**/*", "node_modules/grunt-newer/.cache"] build: ["build/**/*", "node_modules/grunt-newer/.cache"],
release: ["build/vendor", "build/app.js.map", "build/config.json", "build/style.css*"]
} }
}); });