Skip to content

Commit

Permalink
fix: webpack test failed
Browse files Browse the repository at this point in the history
  • Loading branch information
ruleeeer committed Sep 15, 2024
1 parent 306c0ac commit 82b132c
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 6 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"packages/**"
],
"engines": {
"node": "^14.18.0 || >=16.0.0",
"pnpm": ">=8.0.1"
"node": ">=16.0.0",
"pnpm": ">=9.0.0"
},
"author": "@originjs",
"license": "MulanPSL-2.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,13 @@ module.exports = {
},
shared: {
react: {
// eager: true,
// singleton: true,
eager: true,
requiredVersion: '^16.12.0'
},
'react-dom': {
// eager: true,
// singleton: true,
eager: true,
requiredVersion: '^16.12.0'
}
}
Expand Down
5 changes: 5 additions & 0 deletions packages/examples/vitestSetup-serve.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ beforeAll(async (s) => {
}
execa('pnpm', ['run', 'serve'], { cwd: testDir, stdio: 'inherit' })
await execa('pnpm', ['run', 'build'], { cwd: testDir, stdio: 'inherit' })
sleep(3 * 1000);

const port = 5000
// use resolved port/base from server
Expand All @@ -101,6 +102,10 @@ beforeAll(async (s) => {
}
}, 60000)

function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}

afterAll(async () => {
await page?.close()
skipError = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ module.exports = (env = {}) => ({
vue: {
// singleton: true,
// import: false,
requiredVersion: '^3.0.0'
requiredVersion: '^3.0.0',
eager: true,
}
}
}),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
<script src="dist/main.js"></script>
<div id="app"></div>
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ module.exports = (env = {}) => ({
vue: {
// singleton: true,
// import: false,
eager: true,
requiredVersion: '^3.0.0'
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ module.exports = (env = {}) => ({
vue: {
// singleton: true,
// import: false,
eager: true,
requiredVersion: '^3.0.0'
}
}
Expand Down
2 changes: 2 additions & 0 deletions packages/examples/webpack-host/host/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,11 @@ module.exports = {
},
shared: {
react: {
eager: true,
singleton: true,
},
'react-dom': {
eager: true,
singleton: true,
},
},
Expand Down

0 comments on commit 82b132c

Please sign in to comment.