Skip to content

Commit

Permalink
wip: SSR
Browse files Browse the repository at this point in the history
  • Loading branch information
damassi committed Nov 28, 2024
1 parent 42b12c8 commit bb19db9
Showing 1 changed file with 47 additions and 32 deletions.
79 changes: 47 additions & 32 deletions rsbuild.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,41 +6,56 @@ import { pluginNodePolyfill } from "@rsbuild/plugin-node-polyfill"
const basePath = process.cwd()

export default defineConfig({
plugins: [pluginReact(), pluginNodePolyfill()],
source: {
entry: {
client: "./src/client.tsx",
},
},
tools: {
swc: {
jsc: {
experimental: {
plugins: [
[
"@swc/plugin-styled-components",
{
ssr: true,
displayName: true,
},
],
[
"@swc/plugin-relay",
{
rootDir: path.resolve(basePath),
artifactDirectory: "src/__generated__",
language: "typescript",
},
],
],
environments: {
web: {
plugins: [pluginReact(), pluginNodePolyfill()],
source: {
entry: {
client: "./src/client.tsx",
},
},
tools: {
swc: {
jsc: {
experimental: {
plugins: [
[
"@swc/plugin-styled-components",
{
ssr: true,
displayName: true,
},
],
[
"@swc/plugin-relay",
{
rootDir: path.resolve(basePath),
artifactDirectory: "src/__generated__",
language: "typescript",
},
],
],
},
},
},
},
output: {
target: "web",
externals: {
// Required because getAsyncStorage isn't using async import()
async_hooks: "async_hooks",
},
},
},
},
output: {
externals: {
// Required because getAsyncStorage isn't using async import()
async_hooks: "async_hooks",
node: {
source: {
entry: {
index: "./src/index.js",
},
},
output: {
target: "node",
},
},
},
})

0 comments on commit bb19db9

Please sign in to comment.