Skip to content

Commit 1ee03c9

Browse files
ToilalLinusBorg
authored andcommitted
Remove useless code when lint is not chosen (vuejs-templates#1165)
1 parent 9d1674d commit 1ee03c9

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

template/build/webpack.base.conf.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ function resolve (dir) {
88
return path.join(__dirname, '..', dir)
99
}
1010

11-
const createLintingRule = () => ({
11+
{{#lint}}const createLintingRule = () => ({
1212
test: /\.(js|vue)$/,
1313
loader: 'eslint-loader',
1414
enforce: 'pre',
@@ -17,7 +17,7 @@ const createLintingRule = () => ({
1717
formatter: require('eslint-friendly-formatter'),
1818
emitWarning: !config.dev.showEslintErrorsInOverlay
1919
}
20-
})
20+
}){{/lint}}
2121

2222
module.exports = {
2323
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)