Skip to content
This repository has been archived by the owner on Aug 29, 2020. It is now read-only.

[enhancement]Partially hot-reload the script #15

Open
tingwei628 opened this issue Dec 7, 2018 · 2 comments
Open

[enhancement]Partially hot-reload the script #15

tingwei628 opened this issue Dec 7, 2018 · 2 comments

Comments

@tingwei628
Copy link
Owner

each bundle has its own requesteach bundle has its own request (compared with each bundle hashkey)

@tingwei628 tingwei628 changed the title [enhanment]Partially hot-reload the script [enhancement]Partially hot-reload the script Dec 7, 2018
@tingwei628
Copy link
Owner Author

// after getting notified, it started to send a http request to localhost server
var requestPath = "";
var request = new XMLHttpRequest();
request.open("GET",[file_path], true);
request.send(null);
request.onreadystatechange = function() {
    if (request.readyState === 4 && request.status === 200) {
        console.error('error');
    } else {
        // remove and append child to document.body
    }
}

@tingwei628
Copy link
Owner Author

tingwei628 commented Jan 26, 2019

<script type="module" src="js/index.min.js"><script>

Ref How to use ECMAScript modules to build modular components in JavaScript@SaidHayani

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant