mirror of
https://github.com/node-red/node-red
synced 2024-11-21 23:48:30 +00:00
Set NODE_ENV in grunt dev task to serve non-minified assets
This commit is contained in:
parent
f11b906fd9
commit
0bef04ae0a
@ -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',
|
||||
'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',
|
||||
'Developer mode: run node-red, watch for source changes and build/restart',
|
||||
['build','concurrent:dev']);
|
||||
['build','setDevEnv','concurrent:dev']);
|
||||
|
||||
grunt.registerTask('release',
|
||||
'Create distribution zip file',
|
||||
|
@ -177,7 +177,7 @@
|
||||
<script src="vendor/vendor.js"></script>
|
||||
<script src="vendor/ace/ace.js"></script>
|
||||
<script src="vendor/ace/ext-language_tools.js"></script>
|
||||
<script src="red/red.min.js"></script>
|
||||
<script src="{{ asset.red }}"></script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
@ -28,6 +28,9 @@ var defaultContext = {
|
||||
header: {
|
||||
title: "Node-RED",
|
||||
image: "red/images/node-red.png"
|
||||
},
|
||||
asset: {
|
||||
red: (process.env.NODE_ENV == "development")? "red/red.js":"red/red.min.js"
|
||||
}
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user