mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-23 14:15:13 +00:00
Fix lint style
This commit is contained in:
parent
f89722e7c8
commit
ec8291ea4c
@ -205,7 +205,7 @@ function * generateRoutesAndFiles () {
|
|||||||
if (typeof p === 'string') {
|
if (typeof p === 'string') {
|
||||||
return { src: r(this.srcDir, p), ssr: true }
|
return { src: r(this.srcDir, p), ssr: true }
|
||||||
}
|
}
|
||||||
return { src: r(this.srcDir, p.src), ssr: (p.ssr === false ? false : true), injectAs: (p.injectAs || false) }
|
return { src: r(this.srcDir, p.src), ssr: (p.ssr !== false), injectAs: (p.injectAs || false) }
|
||||||
}),
|
}),
|
||||||
appPath: './App.vue',
|
appPath: './App.vue',
|
||||||
layouts: layouts,
|
layouts: layouts,
|
||||||
|
@ -16,15 +16,15 @@ import pify from 'pify'
|
|||||||
const rename = pify(fs.rename)
|
const rename = pify(fs.rename)
|
||||||
|
|
||||||
// offline plugin copy generated assets to static directory
|
// offline plugin copy generated assets to static directory
|
||||||
function OfflinePluginCopyAssetsPlugin(assets, toDir) {
|
function OfflinePluginCopyAssetsPlugin (assets, toDir) {
|
||||||
this.assets = assets
|
this.assets = assets
|
||||||
this.toDir = toDir
|
this.toDir = toDir
|
||||||
}
|
}
|
||||||
OfflinePluginCopyAssetsPlugin.prototype.apply = function(compiler) {
|
OfflinePluginCopyAssetsPlugin.prototype.apply = function (compiler) {
|
||||||
compiler.plugin('after-emit', function(compilation, callback) {
|
compiler.plugin('after-emit', function (compilation, callback) {
|
||||||
const assets = this.assets.length > 0 ? this.assets : []
|
const assets = this.assets.length > 0 ? this.assets : []
|
||||||
|
|
||||||
if (!fs.existsSync(this.toDir)){
|
if (!fs.existsSync(this.toDir)) {
|
||||||
fs.mkdirSync(this.toDir)
|
fs.mkdirSync(this.toDir)
|
||||||
fs.mkdirSync(`${this.toDir}/appcache`)
|
fs.mkdirSync(`${this.toDir}/appcache`)
|
||||||
}
|
}
|
||||||
@ -36,12 +36,12 @@ OfflinePluginCopyAssetsPlugin.prototype.apply = function(compiler) {
|
|||||||
|
|
||||||
Promise.all(renamePromises)
|
Promise.all(renamePromises)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
console.log('\noffline content to static directory...')
|
console.log('\nOffline content to static directory...') // eslint-disable-line no-console
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
console.error('\noffline-plugin copy error', error)
|
console.error('\nOffline-plugin copy error', error) // eslint-disable-line no-console
|
||||||
});
|
})
|
||||||
}.bind(this));
|
}.bind(this))
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -150,8 +150,9 @@ export default function () {
|
|||||||
config.plugins.push(
|
config.plugins.push(
|
||||||
new OfflinePlugin(offlineOpts),
|
new OfflinePlugin(offlineOpts),
|
||||||
new OfflinePluginCopyAssetsPlugin(
|
new OfflinePluginCopyAssetsPlugin(
|
||||||
['sw.js', 'appcache/manifest.appcache', 'appcache/manifest.html'
|
['sw.js', 'appcache/manifest.appcache', 'appcache/manifest.html'],
|
||||||
], 'static')
|
'static'
|
||||||
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
// Webpack Bundle Analyzer
|
// Webpack Bundle Analyzer
|
||||||
|
Loading…
Reference in New Issue
Block a user