Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat:added no content hashing option to build cli #1934

Merged
merged 3 commits into from Sep 25, 2018
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/cli.js
Expand Up @@ -132,6 +132,7 @@ program
.option('--no-minify', 'disable minification')
.option('--no-cache', 'disable the filesystem cache')
.option('--no-source-maps', 'disable sourcemaps')
.option('--no-content-hash', 'disable content hashing')
.option(
'--experimental-scope-hoisting',
'enable experimental scope hoisting/tree shaking support'
Expand Down Expand Up @@ -193,8 +194,11 @@ async function bundle(main, command) {
}

if (command.name() === 'build') {
command.production = true;
process.env.NODE_ENV = process.env.NODE_ENV || 'production';
command.watch = false;
process.env.NODE_ENV =
process.env.NODE_ENV || command.contentHash
? 'production'
: 'development';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we should change the behavior here.

} else {
process.env.NODE_ENV = process.env.NODE_ENV || 'development';
}
Expand Down