From df6b52736e6a8f19b7a3ac875b2d218f6a770efc Mon Sep 17 00:00:00 2001 From: Pavel Prichodko <14926950+prichodko@users.noreply.github.com> Date: Tue, 28 Jun 2022 16:54:21 +0200 Subject: [PATCH] set mode to development during dev --- packages/status-js/package.json | 2 +- packages/status-js/vite.config.ts | 13 ++++--------- packages/status-react/package.json | 2 +- packages/status-react/src/routes/index.tsx | 12 ++++++------ packages/status-react/vite.config.ts | 9 ++++----- 5 files changed, 16 insertions(+), 22 deletions(-) diff --git a/packages/status-js/package.json b/packages/status-js/package.json index 4c9f340d..623d0a7f 100644 --- a/packages/status-js/package.json +++ b/packages/status-js/package.json @@ -19,7 +19,7 @@ "url": "https://github.com/status-im/status-web/issues" }, "scripts": { - "dev": "vite build --watch", + "dev": "vite build --watch --mode development", "build": "vite build && yarn typegen", "test": "vitest", "lint": "eslint src", diff --git a/packages/status-js/vite.config.ts b/packages/status-js/vite.config.ts index 1d05f78a..96cb40f5 100644 --- a/packages/status-js/vite.config.ts +++ b/packages/status-js/vite.config.ts @@ -1,6 +1,5 @@ /// -import { resolve } from 'node:path' import { defineConfig } from 'vite' import { dependencies } from './package.json' @@ -10,21 +9,17 @@ const external = [ // ...Object.keys(peerDependencies || {}), ].map(name => new RegExp(`^${name}(/.*)?`)) -export default defineConfig(({ command }) => { +export default defineConfig(({ mode }) => { return { - resolve: { - alias: { - '~': resolve('.'), - }, - }, build: { + target: 'es2020', lib: { entry: './src/index.ts', fileName: 'index', formats: ['es'], }, - target: 'es2020', - emptyOutDir: command === 'build', + sourcemap: true, + emptyOutDir: mode === 'production', rollupOptions: { external, }, diff --git a/packages/status-react/package.json b/packages/status-react/package.json index da98e817..9c7a0759 100644 --- a/packages/status-react/package.json +++ b/packages/status-react/package.json @@ -19,7 +19,7 @@ "url": "https://github.com/status-im/status-web/issues" }, "scripts": { - "dev": "vite build --watch", + "dev": "vite build --watch --mode development", "build": "vite build && yarn typegen", "#test": "vitest", "typecheck": "tsc", diff --git a/packages/status-react/src/routes/index.tsx b/packages/status-react/src/routes/index.tsx index ee418bb2..9583da36 100644 --- a/packages/status-react/src/routes/index.tsx +++ b/packages/status-react/src/routes/index.tsx @@ -46,9 +46,9 @@ export const Community = (props: Props) => { return ( - - - + + + @@ -65,9 +65,9 @@ export const Community = (props: Props) => { - - - + + + ) } diff --git a/packages/status-react/vite.config.ts b/packages/status-react/vite.config.ts index ad770ec7..31033699 100644 --- a/packages/status-react/vite.config.ts +++ b/packages/status-react/vite.config.ts @@ -11,7 +11,7 @@ const external = [ ...Object.keys(peerDependencies || {}), ].map(name => new RegExp(`^${name}(/.*)?`)) -export default defineConfig(({ command }) => { +export default defineConfig(({ mode }) => { return { resolve: { alias: { @@ -19,15 +19,14 @@ export default defineConfig(({ command }) => { }, }, build: { + target: 'es2020', lib: { entry: './src/index.tsx', fileName: 'index', formats: ['es'], }, - emptyOutDir: command === 'build', - // sourcemap: true, - target: 'es2020', - + sourcemap: true, + emptyOutDir: mode === 'production', rollupOptions: { external, },