Build process now allows console.log, except when the production flag is set on yarn build, in which case it will throw an error.
This commit is contained in:
8
.eslintrcProd
Normal file
8
.eslintrcProd
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
"extends": [
|
||||||
|
"./package.json"
|
||||||
|
],
|
||||||
|
"rules": {
|
||||||
|
"no-console": ["error"],
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -56,6 +56,7 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"rules": {
|
"rules": {
|
||||||
|
"no-console": ["off"],
|
||||||
"comma-dangle": [
|
"comma-dangle": [
|
||||||
"error",
|
"error",
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ const config = merge({
|
|||||||
root: rootPath,
|
root: rootPath,
|
||||||
assets: path.join(rootPath, 'resources/assets'),
|
assets: path.join(rootPath, 'resources/assets'),
|
||||||
dist: path.join(rootPath, 'dist'),
|
dist: path.join(rootPath, 'dist'),
|
||||||
|
eslintProd: path.join(rootPath, '.eslintrcProd'),
|
||||||
},
|
},
|
||||||
enabled: {
|
enabled: {
|
||||||
sourceMaps: !isProduction,
|
sourceMaps: !isProduction,
|
||||||
|
|||||||
@@ -41,7 +41,10 @@ let webpackConfig = {
|
|||||||
enforce: 'pre',
|
enforce: 'pre',
|
||||||
test: /\.js$/,
|
test: /\.js$/,
|
||||||
include: config.paths.assets,
|
include: config.paths.assets,
|
||||||
use: 'eslint',
|
loader: 'eslint-loader',
|
||||||
|
options: {
|
||||||
|
configFile: config.env.production ? config.paths.eslintProd : null,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
enforce: 'pre',
|
enforce: 'pre',
|
||||||
|
|||||||
Reference in New Issue
Block a user