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:
parent
66a257411a
commit
2e4eb77056
@ -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++) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user