fix: build bug

This commit is contained in:
dream2023 2024-02-07 08:12:50 +08:00
parent 918087f055
commit 2904a339fd
4 changed files with 6 additions and 6 deletions

View File

@ -15,7 +15,7 @@ RUN cd /tmp && \
NEWVERSION="$(cat lerna.json | jq '.version' | tr -d '"').$(date +'%Y%m%d%H%M%S')" \
&& tmp=$(mktemp) \
&& jq ".version = \"${NEWVERSION}\"" lerna.json > "$tmp" && mv "$tmp" lerna.json
RUN yarn install && yarn build --no-dts --sourcemap --development
RUN yarn install && yarn build --no-dts --development
RUN git checkout -b release-$(date +'%Y%m%d%H%M%S') \
&& yarn version:alpha -y

View File

@ -18,7 +18,7 @@ indexGenerator.generate();
export default defineConfig({
title: 'Loading...',
devtool: process.env['sourcemap'] ? 'source-map' : false,
devtool: process.env.NODE_ENV === 'development' ? 'source-map' : false,
favicons: ['/favicon/favicon.ico'],
metas: [{ name: 'viewport', content: 'initial-scale=0.1' }],
links: [

View File

@ -39,7 +39,7 @@ export function buildEsm(cwd: string, userConfig: UserConfig, sourcemap: boolean
'process.env.__E2E__': process.env.__E2E__ ? true : false,
},
build: {
minify: false,
minify: process.env.NODE_ENV === 'production',
outDir,
cssCodeSplit: true,
emptyOutDir: true,
@ -78,13 +78,13 @@ export async function buildLib(
await viteBuild(
userConfig.modifyViteConfig({
mode: 'production',
mode: process.env.NODE_ENV || 'production',
esbuild: {
format: 'cjs',
},
build: {
outDir,
minify: false,
minify: process.env.NODE_ENV === 'production',
sourcemap,
lib: {
entry: path.join(cwd, 'es/index.ts'),

View File

@ -318,7 +318,7 @@ export async function buildPluginClient(cwd: string, userConfig: UserConfig, sou
},
logLevel: 'warn',
build: {
minify: sourcemap,
minify: process.env.NODE_ENV === 'production',
outDir,
cssCodeSplit: false,
emptyOutDir: true,