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

[CLI] Change --no-* commands to --disable-* #4832

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions packages/gatsby-cli/src/create-cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ function buildLocalCommands(cli, isLocalSite) {
function getCommandHandler(command, handler) {
return argv => {
report.setVerbose(!!argv.verbose)
report.setNoColor(!!argv.noColor)
report.setNoColor(!!argv.disableColor)

process.env.gatsby_log_level = argv.verbose ? `verbose` : `normal`
report.verbose(`set gatsby_log_level: "${process.env.gatsby_log_level}"`)
Expand Down Expand Up @@ -124,7 +124,7 @@ function buildLocalCommands(cli, isLocalSite) {
type: `boolean`,
default: false,
describe: `Build site with link paths prefixed (set prefix in your config).`,
}).option(`no-uglify`, {
}).option(`disable-uglify`, {
type: `boolean`,
default: false,
describe: `Build site without uglifying JS bundles (for debugging).`,
Expand Down Expand Up @@ -194,7 +194,7 @@ module.exports = (argv, handlers) => {
describe: `Turn on verbose output`,
global: true,
})
.option(`no-color`, {
.option(`disable-color`, {
default: false,
type: `boolean`,
describe: `Turn off the color in output`,
Expand Down
2 changes: 1 addition & 1 deletion packages/gatsby/src/commands/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ type BuildArgs = {
sitePackageJson: object,
browserslist: string[],
prefixPaths: boolean,
noUglify: boolean,
disableUglify: boolean,
}

module.exports = async function build(program: BuildArgs) {
Expand Down
4 changes: 2 additions & 2 deletions packages/gatsby/src/utils/babel-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ function findBabelPackage(directory) {
* the paths will be absolute so that Babel behaves as expected.
*/
module.exports = async function babelConfig(program, stage) {
const { directory, noUglify } = program
const { directory, disableUglify } = program

let babelrc = findBabelrc(directory) || findBabelPackage(directory)

Expand All @@ -149,7 +149,7 @@ module.exports = async function babelConfig(program, stage) {
require.resolve(`babel-preset-env`),
{
loose: true,
uglify: !noUglify,
uglify: !disableUglify,
modules: `commonjs`,
targets: {
browsers: program.browserslist,
Expand Down
4 changes: 2 additions & 2 deletions packages/gatsby/src/utils/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ module.exports = async (
// webpack config.
const stage = suppliedStage
const babelConfig = await genBabelConfig(program, suppliedStage)
const { noUglify } = program
const { disableUglify } = program

function processEnv(stage, defaultNodeEnv) {
debug(`Building env for "${stage}"`)
Expand Down Expand Up @@ -322,7 +322,7 @@ module.exports = async (
// new WebpackStableModuleIdAndHash({ seed: 9, hashSize: 47 }),
new HashedChunkIdsPlugin(),
]
if (!noUglify) {
if (!disableUglify) {
// Minify JavaScript.
plugins.push(
new webpack.optimize.UglifyJsPlugin({
Expand Down