phonegap / phonegap-template-vue-f7-blank

A blank PhoneGap template using Vue.js and Framework7
Apache License 2.0
33 stars 14 forks source link

Turn off quote stripping in HTML minify #12

Closed motatoes closed 6 years ago

motatoes commented 7 years ago

Related to this issue, I was having problems testing my app in the phonegap app, since it did not refresh automatically. The fix for me was to have the <script type="text/javascript" src="cordova.js"></script> as the last script in the document (it is strange).

As a fix for this I had to:

<% for (var chunk in htmlWebpackPlugin.files.chunks) { %>
<script type="text/javascript" src="<%= htmlWebpackPlugin.files.chunks[chunk].entry %>"></script>
<% } %>
<script type="text/javascript" src="cordova.js"></script>

I can submit a PR with these changes if required :)

devgeeks commented 6 years ago

Would turning off removeAttributeQuotes help?

https://github.com/phonegap/phonegap-template-vue-f7-blank/blob/master/template/build/webpack.prod.conf.js#L52

motatoes commented 6 years ago

Hi @devgeeks

I can confirm that the following fixes the reload issue:

1- turning off removeAttributeQuotes as you stated and 2- Adding the MIME type to the cordova script tag in src/index.html:

<script type="text/javascript" src="cordova.js"></script>
devgeeks commented 6 years ago

@motatoes OK. Thanks for working that out. I'll update all three templates with those fixes and publish to npm!

devgeeks commented 6 years ago

Published to NPM as well.

Thanks @motatoes