Enable sourcemaps on dev and prod environments (both minified and normal).

This commit is contained in:
Paulo Reis 2017-10-24 16:03:59 +01:00
parent 83a1b2f5a0
commit 9b128591b1

View file

@ -28,8 +28,10 @@ module.exports = (grunt) ->
exec: exec:
run: run:
command:"node app.js | ./node_modules/logger-sharelatex/node_modules/bunyan/bin/bunyan --color" command:"node app.js | ./node_modules/logger-sharelatex/node_modules/bunyan/bin/bunyan --color"
cssmin: cssmin_sl:
command:"node_modules/clean-css/bin/cleancss --s0 -o public/stylesheets/style.css public/stylesheets/style.css" command:"node_modules/clean-css/bin/cleancss --s0 --source-map -o public/stylesheets/style.css public/stylesheets/style.css"
cssmin_ol:
command:"node_modules/clean-css/bin/cleancss --s0 --source-map -o public/stylesheets/ol-style.css public/stylesheets/ol-style.css"
watch: watch:
@ -139,26 +141,29 @@ module.exports = (grunt) ->
app: app:
options: options:
sourceMap: true sourceMap: true
sourceMapFilename: "public/stylesheets/style.map" sourceMapFilename: "public/stylesheets/style.css.map"
sourceMapBasepath: "public/stylesheets" sourceMapBasepath: "public/stylesheets"
files: files:
"public/stylesheets/style.css": "public/stylesheets/style.less" "public/stylesheets/style.css": "public/stylesheets/style.less"
ol: ol:
options: options:
sourceMap: true sourceMap: true
sourceMapFilename: "public/stylesheets/ol-style.map" sourceMapFilename: "public/stylesheets/ol-style.css.map"
sourceMapBasepath: "public/stylesheets" sourceMapBasepath: "public/stylesheets"
files: files:
"public/stylesheets/ol-style.css": "public/stylesheets/ol-style.less" "public/stylesheets/ol-style.css": "public/stylesheets/ol-style.less"
postcss: postcss:
options: options:
map: true, map:
prev: "public/stylesheets/"
inline: false
sourcesContent: true
processors: [ processors: [
require('autoprefixer')({browsers: [ 'last 2 versions', 'ie >= 10' ]}) require('autoprefixer')({browsers: [ 'last 2 versions', 'ie >= 10' ]})
] ]
dist: dist:
src: 'public/stylesheets/style.css' src: [ "public/stylesheets/style.css", "public/stylesheets/ol-style.css" ]
env: env:
run: run:
@ -389,7 +394,7 @@ module.exports = (grunt) ->
grunt.registerTask 'compile:server', 'Compile the server side coffee script', ['clean:app', 'coffee:app', 'coffee:app_dir', 'compile:modules:server'] grunt.registerTask 'compile:server', 'Compile the server side coffee script', ['clean:app', 'coffee:app', 'coffee:app_dir', 'compile:modules:server']
grunt.registerTask 'compile:client', 'Compile the client side coffee script', ['coffee:client', 'coffee:sharejs', 'wrap_sharejs', "compile:modules:client", 'compile:modules:inject_clientside_includes'] grunt.registerTask 'compile:client', 'Compile the client side coffee script', ['coffee:client', 'coffee:sharejs', 'wrap_sharejs', "compile:modules:client", 'compile:modules:inject_clientside_includes']
grunt.registerTask 'compile:css', 'Compile the less files to css', ['less', 'postcss:dist'] grunt.registerTask 'compile:css', 'Compile the less files to css', ['less', 'postcss:dist']
grunt.registerTask 'compile:minify', 'Concat and minify the client side js', ['requirejs', "file_append", "exec:cssmin",] grunt.registerTask 'compile:minify', 'Concat and minify the client side js and css', ['requirejs', "file_append", "exec:cssmin_sl", "exec:cssmin_ol"]
grunt.registerTask 'compile:unit_tests', 'Compile the unit tests', ['clean:unit_tests', 'coffee:unit_tests'] grunt.registerTask 'compile:unit_tests', 'Compile the unit tests', ['clean:unit_tests', 'coffee:unit_tests']
grunt.registerTask 'compile:acceptance_tests', 'Compile the acceptance tests', ['clean:acceptance_tests', 'coffee:acceptance_tests'] grunt.registerTask 'compile:acceptance_tests', 'Compile the acceptance tests', ['clean:acceptance_tests', 'coffee:acceptance_tests']
grunt.registerTask 'compile:smoke_tests', 'Compile the smoke tests', ['coffee:smoke_tests'] grunt.registerTask 'compile:smoke_tests', 'Compile the smoke tests', ['coffee:smoke_tests']