diff --git a/lib/app/index.js b/lib/app/index.js index eeffda05f4..bfcecfd48c 100644 --- a/lib/app/index.js +++ b/lib/app/index.js @@ -12,9 +12,8 @@ import { setContext, getLocation, getRouteData } from './utils' <% if (store) { %>import { createStore } from './store.js'<% } %> /* Plugins */ - -<% plugins.forEach(plugin => { %>// <%= plugin.src %><%= (plugin.ssr===false) ? ' (Only included in client bundle)' : '' %> -import <%= plugin.name %> from '<%= plugin.name %>'<% }) %> +<% plugins.forEach(plugin => { %>import <%= plugin.name %> from '<%= plugin.name %>' // Source: <%= relativeToBuild(plugin.src) %><%= (plugin.ssr===false) ? ' (ssr: false)' : '' %> +<% }) %> // Component: Vue.component(NoSSR.name, NoSSR) diff --git a/lib/builder/builder.js b/lib/builder/builder.js index 9b42142c30..2536b04655 100644 --- a/lib/builder/builder.js +++ b/lib/builder/builder.js @@ -69,14 +69,14 @@ export default class Builder { } get plugins() { - return this.options.plugins.map((p, i) => { + return _.uniqBy(this.options.plugins.map((p, i) => { if (typeof p === 'string') p = { src: p } return { src: this.nuxt.resolvePath(p.src), ssr: (p.ssr !== false), - name: basename(p.src, extname(p.src)).replace(/[^a-zA-Z?\d\s:]/g, '') + '_plugin_' + hash(p.src) + name: basename(p.src, extname(p.src)).replace(/[^a-zA-Z?\d\s:]/g, '') + '_' + hash(p.src) } - }) + }), p => p.name) } vendor() {