Skip to content

Commit

Permalink
Fix not argument
Browse files Browse the repository at this point in the history
  • Loading branch information
ponjs committed Feb 14, 2022
1 parent 13a5284 commit 28421de
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const webpack = require('webpack')

function getModeName() {
const index = process.argv.indexOf('--mode')
return process.argv[index + 1] || ''
return index === -1 ? '' : process.argv[index + 1] || ''
}

function loadEnvironment(envPath) {
Expand Down Expand Up @@ -41,7 +41,7 @@ function overrideCracoConfig({ cracoConfig, pluginOptions = {} }) {
}
} else {
cracoConfig.webpack = {
plugins: [plugin]
plugins: [plugin],
}
}
}
Expand All @@ -50,5 +50,5 @@ function overrideCracoConfig({ cracoConfig, pluginOptions = {} }) {
}

module.exports = {
overrideCracoConfig
overrideCracoConfig,
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "craco-plugin-env",
"description": "An environment plugin for craco",
"version": "1.0.3",
"version": "1.0.4",
"main": "index.js",
"repository": "https://github.com/ponjs/craco-plugin-env.git",
"keywords": [
Expand Down

0 comments on commit 28421de

Please sign in to comment.