Skip to content

Commit

Permalink
fix: ssr build error caused by React is not defined
Browse files Browse the repository at this point in the history
  • Loading branch information
sanyuan0704 committed Sep 23, 2022
1 parent 8964711 commit c0178c8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
6 changes: 1 addition & 5 deletions src/node/build.ts
Expand Up @@ -333,15 +333,11 @@ class SSGBuilder {
await createIslandPlugins(this.#config, isServer),
...(options?.plugins || [])
],
esbuild: {
// Reserve island component name
minifyIdentifiers: !isServer
},
ssr: {
noExternal: ['lodash-es', 'react-router-dom']
},
build: {
minify: !process.env.DEBUG,
minify: !process.env.DEBUG && !isServer,
ssr: isServer,
outDir: isServer
? join(this.#root, TEMP_PATH, 'ssr')
Expand Down
6 changes: 1 addition & 5 deletions src/node/plugin-island/islandTransform.ts
@@ -1,8 +1,4 @@
import {
DEFAULT_THEME_PATH,
ISLAND_JSX_RUNTIME_PATH,
TS_REGEX
} from '../constants';
import { ISLAND_JSX_RUNTIME_PATH, TS_REGEX } from '../constants';
import { Plugin, transformWithEsbuild } from 'vite';
import { transformAsync } from '@babel/core';
import babelPluginIsland from '../babel-plugin-island';
Expand Down

0 comments on commit c0178c8

Please sign in to comment.