1
0
mirror of https://github.com/chinchang/web-maker.git synced 2025-05-11 04:45:42 +02:00

app: replace external lib urls with local urls in download zip

This commit is contained in:
Kushagra Gour 2018-08-12 17:36:09 +05:30
parent 66a257411a
commit 2e4eb77056

View File

@ -1077,6 +1077,12 @@ export default class App extends Component {
var fileContent = getCompleteHtml(html, css, js, item, true);
// Replace external lib urls with local relative urls (picked from zip)
fileContent = fileContent.replace(
/<script src="(.*\/)([^/<]*?)"/g,
'<script src="$2"'
);
var zip = new JSZip();
zip.file('index.html', fileContent);
for (let i = 3; i < result.length; i++) {