mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-23 14:15:13 +00:00
Merge pull request #1613 from clarkdo/dev
refactor: fix some code issues
This commit is contained in:
commit
2db304e222
@ -1,15 +1,15 @@
|
||||
module.exports = {
|
||||
build: {
|
||||
filenames: {
|
||||
css: 'styles.[chunkhash].css', // default: common.[chunkhash].css
|
||||
manifest: 'manifest.[hash].js', // default: manifest.[hash].js
|
||||
vendor: 'vendor.[hash].js', // default: vendor.bundle.[hash].js
|
||||
app: 'app.[chunkhash].js' // default: nuxt.bundle.[chunkhash].js
|
||||
css: 'styles.[chunkhash].css', // default: common.[chunkhash].css
|
||||
manifest: 'manifest.[hash].js', // default: manifest.[hash].js
|
||||
vendor: 'vendor.[hash].js', // default: vendor.bundle.[hash].js
|
||||
app: 'app.[chunkhash].js' // default: nuxt.bundle.[chunkhash].js
|
||||
},
|
||||
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
|
||||
|
@ -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$"]}'
|
||||
}
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
})
|
||||
})
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user