Skip to content

Commit

Permalink
refactor(browser): move client code into src (#2367)
Browse files Browse the repository at this point in the history
* fix: refactor browser package

* chore:fix CI

* chore: move public folder inside src/client

* chore: revert lock file

* chore: .
  • Loading branch information
userquin authored Nov 23, 2022
1 parent 4b21c59 commit aa6ee0f
Show file tree
Hide file tree
Showing 9 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions packages/browser/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@
],
"scripts": {
"build": "rimraf dist && pnpm build:node && pnpm build:client && pnpm copy",
"build:client": "vite build",
"build:client": "vite build src/client",
"build:node": "rollup -c",
"dev:client": "vite build --watch",
"dev:client": "vite build src/client --watch",
"dev:node": "rollup -c --watch --watch.include=node",
"dev": "rimraf dist && run-p dev:node dev:client",
"copy": "esno scripts/copy-ui-to-browser.ts",
Expand Down
4 changes: 2 additions & 2 deletions packages/browser/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const plugins = [
export default () => [
{
input: [
'./node/index.ts',
'./src/node/index.ts',
],
output: {
dir: 'dist',
Expand All @@ -39,7 +39,7 @@ export default () => [
plugins,
},
{
input: './node/index.ts',
input: './src/node/index.ts',
output: {
file: 'dist/index.d.ts',
format: 'esm',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@
</head>
<body>
<iframe id="vitest-ui" src=""></iframe>
<script type="module" src="./client/main.ts"></script>
<script type="module" src="/main.ts"></script>
</body>
</html>
File renamed without changes.
File renamed without changes
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default defineConfig({
},
build: {
minify: false,
outDir: './dist/client',
outDir: '../../dist/client',
emptyOutDir: false,
},
})
File renamed without changes.
6 changes: 3 additions & 3 deletions pnpm-lock.yaml

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

2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"paths": {
"@vitest/ws-client": ["./packages/ws-client/src/index.ts"],
"@vitest/ui": ["./packages/ui/node/index.ts"],
"@vitest/browser": ["./packages/browser/node/index.ts"],
"@vitest/browser": ["./packages/browser/src/node/index.ts"],
"#types": ["./packages/vitest/src/index.ts"],
"~/*": ["./packages/ui/client/*"],
"vitest": ["./packages/vitest/src/index.ts"],
Expand Down

0 comments on commit aa6ee0f

Please sign in to comment.