minor fixes

This commit is contained in:
Pooya Parsa 2017-12-08 12:54:16 +03:30
parent c1d283bb94
commit 786b25adb8
2 changed files with 3 additions and 2 deletions

View File

@ -71,10 +71,11 @@ export default class Builder {
get plugins() {
return _.uniqBy(this.options.plugins.map((p, i) => {
if (typeof p === 'string') p = { src: p }
const pluginBaseName = basename(p.src, extname(p.src)).replace(/[^a-zA-Z?\d\s:]/g, '')
return {
src: this.nuxt.resolvePath(p.src),
ssr: (p.ssr !== false),
name: basename(p.src, 'nuxt_plugin_' + extname(p.src)).replace(/[^a-zA-Z?\d\s:]/g, '') + '_' + hash(p.src)
name: 'nuxt_plugin_' + pluginBaseName + '_' + hash(p.src)
}
}), p => p.name)
}

View File

@ -4,7 +4,7 @@ export default class WarnFixPlugin {
stats.compilation.warnings = stats.compilation.warnings.filter(warn => {
if (warn.name === 'ModuleDependencyWarning' &&
warn.message.includes(`export 'default'`) &&
warn.message.indexOf('nuxt_plugin_') === 0) {
warn.message.includes('nuxt_plugin_')) {
return false
}
return true