Skip to content

Commit

Permalink
update scripts. use analyzer only in dev build
Browse files Browse the repository at this point in the history
  • Loading branch information
Kreezag committed Dec 23, 2024
1 parent c51fd34 commit 4397607
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ RUN sed -i "s/\"version\": \".*\"/\"version\": \"${APP_VERSION}\"/" package.json
RUN sed -i "s/\"version\": \".*\"/\"version\": \"${APP_VERSION}\"/" src/static/manifest.json

RUN yarn install --ignore-scripts
RUN yarn build
RUN yarn generate
RUN rm -rf node_modules

LABEL org.opencontainers.image.source=$REPOSITORY
Expand Down
9 changes: 4 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@
"private": true,
"version": "0.0.1",
"scripts": {
"analyze": "vite build --mode analyze",
"dev": "vite",
"dev": "vite serve",
"preview": "vite preview",
"build-only": "vite build --mode production",
"build": "run-p typecheck \"build-only {@}\" --",
"generate": "yarn build",
"build:prod": "NODE_ENV=prod vite build --minify",
"build:dev": "NODE_ENV=dev vite build",
"generate": "run-p typecheck \"build:prod\"",
"postinstall": "yarn prepare",
"prepare": "husky && husky install",
"lint": "yarn codestyle && yarn typecheck",
Expand Down
6 changes: 4 additions & 2 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@ import { defineConfig } from 'vite'
import { analyzer } from 'vite-bundle-analyzer'
import vueDevTools from 'vite-plugin-vue-devtools'

const isDev = () => {
return process.env.NODE_ENV === 'dev';
}
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
vue(),
analyzer(),
vueDevTools(),
...(isDev() ? [analyzer(), vueDevTools()] : []),
],
resolve: {
alias: {
Expand Down

0 comments on commit 4397607

Please sign in to comment.