Skip to content

Commit

Permalink
chore: update workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
nonzzz committed May 8, 2024
1 parent dd4ae58 commit d356f60
Show file tree
Hide file tree
Showing 4 changed files with 228 additions and 199 deletions.
30 changes: 30 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
client-analyze:
@echo "Analyzing client code..."
@yarn run vite build src/client --config analyze.config.ts
awk '{ print }' dist/client/stats.json > src/client/data.json

build-all: build-server build-client

build-client:
@echo "Building client code..."
@yarn run vite build src/client

build-server:
@echo "Building server code..."
@yarn run rollup --config rollup.config.ts --configPlugin swc3

dev-server:
@echo "Starting server in development mode..."
@yarn run rollup --config rollup.config.ts --configPlugin swc3 --watch

dev-client:
@echo "Starting client in development mode..."
@yarn run vite src/client

test:
@echo "Running tests..."
@yarn run test

lint:
@echo "Linting code..."
@yarn run lint
8 changes: 8 additions & 0 deletions analyze.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { defineConfig, mergeConfig } from 'vite'
import { analyzer } from './src/server'
import conf from './src/client/vite.config'

const c = conf({ command: 'build', mode: 'production' })
export default mergeConfig(c, defineConfig({
plugins: [...c.plugins!, analyzer({ analyzerMode: 'json' })]
}))
Loading

0 comments on commit d356f60

Please sign in to comment.