In the following code from less-node.js, the line pEnv.NODE_ENV = productionEnv ? 'production' : 'development'; overwrites the actual environment such that commands like jspm run ... do not behave as expected. If the module being run imports plugin-less at any point, then NODE_ENV will always be 'production'.
$__System.registerDynamic("@system-env", [], false, function() {
return {
"production": true,
"browser": false,
"node": true,
"dev": false,
"default": true
};
});
$__System.registerDynamic("github:jspm/nodelibs-process@0.2.0-alpha/process-node.js", ["@system-env", "@node/process"], true, function($__require, exports, module) {
;
var define,
global = this,
GLOBAL = this;
var productionEnv = $__require('@system-env').production;
var process = $__require('@node/process');
var pEnv = process.env;
pEnv.NODE_ENV = productionEnv ? 'production' : 'development';
module.exports = process;
return module.exports;
});
I discovered this while working through a separate issue with server-side rendering when plugin-less (via css-plugin-base) attempts to inject into the DOM but document is not defined (of course).
In the following code from
less-node.js
, the linepEnv.NODE_ENV = productionEnv ? 'production' : 'development';
overwrites the actual environment such that commands likejspm run ...
do not behave as expected. If the module being run imports plugin-less at any point, thenNODE_ENV
will always be'production'
.I discovered this while working through a separate issue with server-side rendering when plugin-less (via css-plugin-base) attempts to inject into the DOM but
document
is not defined (of course).