Skip to content

Commit

Permalink
chore: localize remote assets to reduce test time
Browse files Browse the repository at this point in the history
  • Loading branch information
ClarkXia committed Oct 9, 2023
1 parent 6f18c3d commit 87d13ad
Show file tree
Hide file tree
Showing 11 changed files with 60 additions and 2 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ node_modules/
dist/
out/
compiled/
public/

# node 覆盖率文件
coverage/
Expand Down
13 changes: 13 additions & 0 deletions examples/icestark-layout/ice.config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,18 @@ export default defineConfig(() => ({
icestark({
type: 'framework',
}),
{
setup({ onGetConfig }) {
// Enable option `enableCopyPlugin`, so devserver can access public folder when run test.
if (process.env.NODE_ENV === 'test') {
onGetConfig((config) => {
return {
...config,
enableCopyPlugin: true,
}
});
}
}
}
]
}));

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions examples/icestark-layout/public/page-seller/assets/index.js

Large diffs are not rendered by default.

27 changes: 27 additions & 0 deletions examples/icestark-layout/public/page-seller/assets/vendor.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions examples/icestark-layout/public/page-seller/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<!DOCTYPE html><html><head><meta charset="utf-8"><meta http-equiv="x-ua-compatible" content="ie=edge,chrome=1"><meta name="viewport" content="width=device-width"><title>icestark</title><link rel="stylesheet" href="/page-seller/assets/index.css"></head><body><div id="ice-container"></div><script type="module" src="/page-seller/assets/index.js"></script><script type="module" src="/page-seller/assets/vendor.js"></script></body></html>

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions examples/icestark-layout/public/page-waiter/assets/main.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions examples/icestark-layout/public/page-waiter/assets/vendor.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions examples/icestark-layout/public/page-waiter/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<!doctype html><html lang="en"><head><meta charset="UTF-8"/><link rel="icon" href="/favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1"/><title>Vite App</title><link rel="stylesheet" href="/page-waiter/assets/main.css"></head><body><div id="app"></div><script type="module" src="/page-waiter/assets/main.js"></script></body></html>
4 changes: 2 additions & 2 deletions examples/icestark-layout/src/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ export const icestark = defineFrameworkConfig(() => ({
path: '/seller',
title: '商家平台',
loadScriptMode: 'import',
entry: 'https://iceworks.oss-cn-hangzhou.aliyuncs.com/icestark/child-seller-ice-vite/index.html',
entry: '/page-seller/index.html',
}, {
path: '/waiter',
title: '小二平台',
loadScriptMode: 'import',
entry: 'https://iceworks.oss-cn-hangzhou.aliyuncs.com/icestark/child-vue3-vite/index.html',
entry: '/page-waiter/index.html',
}]),
}));

Expand Down

0 comments on commit 87d13ad

Please sign in to comment.