Akryum / Akryum/vue-cli-plugin-ssr

app.js script chunk rendered twice

Offen
#158 5 Kommentare 4 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
JavaScript
Sterne
441
Forks
69
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

Hi, i'm using v0.6.0.

i'm facing the issue that the app.js chunk is rendered twice: renderScripts() renders the into the index.ssr.html and the htmlPlugin included in vue-cli-plugin-ssr renders <script src=".../app.js"> as well into the markup, such that it gets loaded twice by the browser and vue gets hydrated twice as well.

```html
<body>
....
<script src="/de/suche/app.js" defer>

```

https://webpack.js.org/plugins/html-webpack-plugin/ states:

> The plugin will generate an HTML5 file for you that includes all your webpack bundles in the body using script tags.

The specific code is: https://github.com/Akryum/vue-cli-plugin-ssr/blob/master/lib/webpack.js#L54
If i add `chunks: []` there, it works fine again, such that it is no longer rendered twice.

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.