chore(builder): better naming for plugin generated aliases

Help developers tracing exact source of warns/errors
This commit is contained in:
Pooya Parsa 2017-11-07 13:32:10 +03:30
parent 80fb65040b
commit 1eee113d6d
2 changed files with 6 additions and 3 deletions

View File

@ -10,8 +10,11 @@ import Nuxt from './components/nuxt.js'
import App from '<%= appPath %>' import App from '<%= appPath %>'
import { setContext, getLocation } from './utils' import { setContext, getLocation } from './utils'
<% if (store) { %>import { createStore } from './store.js'<% } %> <% if (store) { %>import { createStore } from './store.js'<% } %>
<% plugins.forEach(plugin => { %>import <%= plugin.name %> from '<%= plugin.name %>'
<% }) %> /* Plugins */
<% plugins.forEach(plugin => { %>// <%= plugin.src %><%= (plugin.ssr===false) ? ' (Only included in client bundle)' : '' %>
import <%= plugin.name %> from '<%= plugin.name %>'<% }) %>
// Component: <no-ssr> // Component: <no-ssr>
Vue.component(NoSSR.name, NoSSR) Vue.component(NoSSR.name, NoSSR)

View File

@ -63,7 +63,7 @@ export default class Builder {
return { return {
src: this.nuxt.resolvePath(p.src), src: this.nuxt.resolvePath(p.src),
ssr: (p.ssr !== false), ssr: (p.ssr !== false),
name: basename(p.src, extname(p.src)).replace(/[^a-zA-Z?\d\s:]/g, '') + '_' + hash(p.src) name: basename(p.src, extname(p.src)).replace(/[^a-zA-Z?\d\s:]/g, '') + '_plugin_' + hash(p.src)
} }
}) })
} }