We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 2c47fcc + e44f4a0 commit bbd06b5Copy full SHA for bbd06b5
packages/wmr/test/fixtures/dynamic-import/index.js
@@ -1,8 +1,18 @@
1
console.log('hello from index.js');
2
-const pages = ['one', 'two'];
3
-const mods = Promise.all(pages.map(page => import(`./pages/${page}.js`))).then(m => {
+
+// eslint-disable-next-line no-async-promise-executor
4
+const mods = new Promise(async resolve => {
5
+ let out = [];
6
7
+ // Use a for loop to ensure a consistent loading order
8
+ for (const page of ['one', 'two']) {
9
+ const m = await import(`./pages/${page}.js`);
10
+ out.push(m);
11
+ }
12
13
console.log('loaded pages');
- console.log(m.map(m => m.default).join());
14
+ console.log(out.map(m => m.default).join());
15
+ resolve(out);
16
});
17
18
export async function prerender() {
0 commit comments