mirror of
https://github.com/nocobase/nocobase
synced 2024-11-16 10:09:21 +00:00
fix: bug
This commit is contained in:
parent
35b4bfeab6
commit
c4eff75175
@ -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
|
||||
RUN yarn install && yarn build --no-dts --sourcemap --development
|
||||
|
||||
RUN git checkout -b release-$(date +'%Y%m%d%H%M%S') \
|
||||
&& yarn version:alpha -y
|
||||
|
@ -18,6 +18,7 @@ indexGenerator.generate();
|
||||
|
||||
export default defineConfig({
|
||||
title: 'Loading...',
|
||||
devtool: process.env['sourcemap'] ? 'source-map' : false,
|
||||
favicons: ['/favicon/favicon.ico'],
|
||||
metas: [{ name: 'viewport', content: 'initial-scale=0.1' }],
|
||||
links: [
|
||||
|
@ -20,7 +20,8 @@ import { Package } from '@lerna/package';
|
||||
import { tarPlugin } from './tarPlugin'
|
||||
|
||||
export async function build(pkgs: string[]) {
|
||||
process.env.NODE_ENV = 'production';
|
||||
const isDev = process.argv.includes('--development');
|
||||
process.env.NODE_ENV = isDev ? 'development' : 'production';
|
||||
|
||||
const packages = getPackages(pkgs);
|
||||
if (packages.length === 0) {
|
||||
@ -135,7 +136,8 @@ function runScript(args: string[], cwd: string, envs: Record<string, string> = {
|
||||
env: {
|
||||
...process.env,
|
||||
...envs,
|
||||
NODE_ENV: 'production',
|
||||
sourcemap: process.argv.includes('--sourcemap') ? 'sourcemap' : undefined,
|
||||
NODE_ENV: process.env.NODE_ENV || 'production',
|
||||
},
|
||||
});
|
||||
}
|
||||
|
@ -32,9 +32,9 @@ export function buildEsm(cwd: string, userConfig: UserConfig, sourcemap: boolean
|
||||
const outDir = path.resolve(cwd, 'es');
|
||||
return viteBuild(
|
||||
userConfig.modifyViteConfig({
|
||||
mode: 'development',
|
||||
mode: process.env.NODE_ENV || 'production',
|
||||
define: {
|
||||
'process.env.NODE_ENV': JSON.stringify('development'),
|
||||
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV || 'production'),
|
||||
'process.env.__TEST__': false,
|
||||
'process.env.__E2E__': process.env.__E2E__ ? true : false,
|
||||
},
|
||||
|
@ -310,15 +310,15 @@ export async function buildPluginClient(cwd: string, userConfig: UserConfig, sou
|
||||
const outputFileName = 'index.js';
|
||||
|
||||
await viteBuild(userConfig.modifyViteConfig({
|
||||
mode: 'development',
|
||||
mode: process.env.NODE_ENV || 'production',
|
||||
define: {
|
||||
'process.env.NODE_ENV': JSON.stringify('development'),
|
||||
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV || 'production'),
|
||||
'process.env.__TEST__': false,
|
||||
'process.env.__E2E__': process.env.__E2E__ ? true : false,
|
||||
},
|
||||
logLevel: 'warn',
|
||||
build: {
|
||||
minify: true,
|
||||
minify: sourcemap,
|
||||
outDir,
|
||||
cssCodeSplit: false,
|
||||
emptyOutDir: true,
|
||||
|
Loading…
Reference in New Issue
Block a user