Use NODE_ENV when building client bundles

This commit is contained in:
Michael Jackson
2020-06-06 09:05:30 -07:00
parent bb0b62943f
commit 78c9de2e0e
2 changed files with 11 additions and 15 deletions

View File

@ -12,8 +12,6 @@ const url = require('rollup-plugin-url');
const entryManifest = require('./plugins/entryManifest');
const pkg = require('./package.json');
const env = process.env.BUILD_ENV || 'development';
const manifest = entryManifest();
const client = ['browse', 'main'].map(entryName => {
@ -47,20 +45,20 @@ const client = ['browse', 'main'].map(entryName => {
}
}),
replace({
'process.env.NODE_ENV': JSON.stringify(env)
'process.env.NODE_ENV': JSON.stringify(
process.env.NODE_ENV || 'development'
)
}),
url({
limit: 5 * 1024,
publicPath: '/_client/'
}),
compiler(
env !== 'production' ? { formatting: 'PRETTY_PRINT' } : undefined
)
compiler()
]
};
});
const dependencies = (env === 'development'
const dependencies = (process.env.NODE_ENV === 'development'
? Object.keys(pkg.dependencies).concat(Object.keys(pkg.devDependencies || {}))
: Object.keys(pkg.dependencies)
).concat('react-dom/server');