Merge pull request #1613 from clarkdo/dev

refactor: fix some code issues
This commit is contained in:
Sébastien Chopin 2017-09-08 11:00:43 +02:00 committed by GitHub
commit 2db304e222
4 changed files with 8 additions and 8 deletions

View File

@ -9,7 +9,7 @@ module.exports = {
vendor: ['lodash'],
extend (config, { dev }) {
if (dev) {
config.devtool = (dev ? 'eval-source-map' : false)
config.devtool = 'eval-source-map'
}
const urlLoader = config.module.rules.find((loader) => loader.loader === 'url-loader')
// Increase limit to 100KO

View File

@ -7,7 +7,7 @@ module.exports = function (options) {
loader: 'ts-loader'
})
// Add TypeScript loader for vue files
for (rule of config.module.rules) {
for (let rule of config.module.rules) {
if (rule.loader === 'vue-loader') {
rule.query.loaders.ts = 'ts-loader?{"appendTsSuffixTo":["\\\\.vue$"]}'
}

View File

@ -486,9 +486,9 @@ export default class Builder extends Tapable {
compiler.run((err, stats) => {
/* istanbul ignore if */
if (err) {
console.error(err) // eslint-disable-line no-console
return reject(err)
}
if (err) return console.error(err) // eslint-disable-line no-console
// Show build stats for production
console.log(stats.toString(this.webpackStats)) // eslint-disable-line no-console

View File

@ -243,7 +243,7 @@ export default class Renderer extends Tapable {
path: this.publicPath,
handler: serveStatic(distDir, {
index: false, // Don't serve index.html template
maxAge: (this.options.dev ? 0 : '1y') // 1 year in production
maxAge: '1y' // 1 year in production
})
})
}