35 lines
1.1 KiB
HTML
35 lines
1.1 KiB
HTML
|
|
<!DOCTYPE html>
|
||
|
|
<html>
|
||
|
|
<head>
|
||
|
|
<title>Loader Integration Test</title>
|
||
|
|
<!-- 引入本地构建的 loader.js -->
|
||
|
|
<script src="../dist/loader.js"></script>
|
||
|
|
<script>
|
||
|
|
// 声明加载:
|
||
|
|
// state 采用默认版本号(验证常规版本拼接)
|
||
|
|
// bootstrap 采用相对路径(验证本地重定向)
|
||
|
|
// base 采用绝对 HTTP 路径(验证自定义域名重定向)
|
||
|
|
Loader.load(
|
||
|
|
'state',
|
||
|
|
'bootstrap:./mock-bootstrap.js',
|
||
|
|
'base:http://127.0.0.1:8084/test/mock-base.js'
|
||
|
|
);
|
||
|
|
</script>
|
||
|
|
</head>
|
||
|
|
<body>
|
||
|
|
<div id="status">loading</div>
|
||
|
|
|
||
|
|
<script type="module">
|
||
|
|
import { Bootstrap } from '@apigo.cc/bootstrap';
|
||
|
|
import { HTTP } from '@apigo.cc/base';
|
||
|
|
|
||
|
|
// 验证导入的重定向模块是否正确加载
|
||
|
|
if (Bootstrap && Bootstrap.isMock && HTTP && HTTP.isMock) {
|
||
|
|
document.getElementById('status').textContent = 'success';
|
||
|
|
} else {
|
||
|
|
document.getElementById('status').textContent = 'failed';
|
||
|
|
}
|
||
|
|
</script>
|
||
|
|
</body>
|
||
|
|
</html>
|