1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

Set NODE_ENV in grunt dev task to serve non-minified assets

This commit is contained in:
Nick O'Leary 2015-05-11 20:24:15 +01:00
parent f11b906fd9
commit 0bef04ae0a
3 changed files with 12 additions and 2 deletions

View File

@ -340,6 +340,13 @@ module.exports = function(grunt) {
} }
} }
}); });
grunt.registerTask('setDevEnv',
'Sets NODE_ENV=development to non-minified assets are used',
function () {
process.env.NODE_ENV = 'development';
});
grunt.registerTask('default', grunt.registerTask('default',
'Builds editor content then runs code style checks and unit tests on all components', 'Builds editor content then runs code style checks and unit tests on all components',
@ -363,7 +370,7 @@ module.exports = function(grunt) {
grunt.registerTask('dev', grunt.registerTask('dev',
'Developer mode: run node-red, watch for source changes and build/restart', 'Developer mode: run node-red, watch for source changes and build/restart',
['build','concurrent:dev']); ['build','setDevEnv','concurrent:dev']);
grunt.registerTask('release', grunt.registerTask('release',
'Create distribution zip file', 'Create distribution zip file',

View File

@ -177,7 +177,7 @@
<script src="vendor/vendor.js"></script> <script src="vendor/vendor.js"></script>
<script src="vendor/ace/ace.js"></script> <script src="vendor/ace/ace.js"></script>
<script src="vendor/ace/ext-language_tools.js"></script> <script src="vendor/ace/ext-language_tools.js"></script>
<script src="red/red.min.js"></script> <script src="{{ asset.red }}"></script>
</body> </body>
</html> </html>

View File

@ -28,6 +28,9 @@ var defaultContext = {
header: { header: {
title: "Node-RED", title: "Node-RED",
image: "red/images/node-red.png" image: "red/images/node-red.png"
},
asset: {
red: (process.env.NODE_ENV == "development")? "red/red.js":"red/red.min.js"
} }
}; };