Skip to content

Commit 2c39018

Browse files
committed
Remove useless code when lint is not chosen
1 parent 2e094c9 commit 2c39018

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

template/build/webpack.base.conf.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@ const vueLoaderConfig = require('./vue-loader.conf')
77
function resolve (dir) {
88
return path.join(__dirname, '..', dir)
99
}
10-
11-
const createLintingRule = () => ({
10+
{{#lint}}const createLintingRule = () => ({
1211
test: /\.(js|vue)$/,
1312
loader: 'eslint-loader',
1413
enforce: 'pre',
@@ -17,7 +16,7 @@ const createLintingRule = () => ({
1716
formatter: require('eslint-friendly-formatter'),
1817
emitWarning: !config.dev.showEslintErrorsInOverlay
1918
}
20-
})
19+
}){{/lint}}
2120

2221
module.exports = {
2322
context: path.resolve(__dirname, '../'),

template/config/index.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,14 @@ module.exports = {
2020
notifyOnErrors: true,
2121
poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions-
2222

23-
// Use Eslint Loader?
23+
{{#lint}}// Use Eslint Loader?
2424
// If true, your code will be linted during bundling and
2525
// linting errors and warnings will be shown in the console.
2626
useEslint: true,
2727
// If true, eslint errors and warnings will also be shown in the error overlay
2828
// in the browser.
2929
showEslintErrorsInOverlay: false,
30+
{{/lint}}
3031

3132
/**
3233
* Source Maps

0 commit comments

Comments
 (0)