@rpcbase/vite 0.28.0 → 0.30.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +17 -8
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -40,7 +40,6 @@ const resolveAliases = {
|
|
|
40
40
|
process.cwd(),
|
|
41
41
|
"./node_modules/set-cookie-parser",
|
|
42
42
|
),
|
|
43
|
-
// "react-dom": path.resolve(import.meta.dirname, "./node_modules/react-dom"),
|
|
44
43
|
}
|
|
45
44
|
|
|
46
45
|
const integratedPackages = [
|
|
@@ -115,6 +114,7 @@ const getBaseConfig = ({ command, mode, isSsrBuild, isPreview }) => {
|
|
|
115
114
|
alias: {
|
|
116
115
|
...resolveAliases,
|
|
117
116
|
},
|
|
117
|
+
dedupe: ["react", "react-dom"],
|
|
118
118
|
preserveSymlinks: true,
|
|
119
119
|
},
|
|
120
120
|
ssr: {
|
|
@@ -134,6 +134,7 @@ const getBaseConfig = ({ command, mode, isSsrBuild, isPreview }) => {
|
|
|
134
134
|
"@rpcbase/form",
|
|
135
135
|
"@rpcbase/router",
|
|
136
136
|
"@radix-ui/*",
|
|
137
|
+
// TMP only in sample app?
|
|
137
138
|
// "react", "react-dom/server",
|
|
138
139
|
// "react-hook-form",
|
|
139
140
|
// "react-dom"
|
|
@@ -150,20 +151,28 @@ export const extendConfig = (userConfig) => {
|
|
|
150
151
|
} else {
|
|
151
152
|
config = userConfig
|
|
152
153
|
}
|
|
153
|
-
|
|
154
154
|
const baseConfig = getBaseConfig({ command, mode, isSsrBuild, isPreview })
|
|
155
|
+
|
|
155
156
|
return mergeConfig(baseConfig, config)
|
|
156
157
|
})
|
|
157
158
|
}
|
|
158
159
|
|
|
159
|
-
export const createServer =
|
|
160
|
-
|
|
161
|
-
|
|
160
|
+
export const createServer = viteCreateServer
|
|
161
|
+
// export const createServer = async (config /* : Record<string, any>*/) => {
|
|
162
|
+
// const env = {
|
|
163
|
+
// command: "serve",
|
|
164
|
+
// mode: process.env.NODE_ENV ?? "development",
|
|
165
|
+
// isSsrBuild: false,
|
|
166
|
+
// isPreview: false,
|
|
167
|
+
// }
|
|
162
168
|
|
|
163
|
-
|
|
169
|
+
// const extendedConfig = extendConfig(config)(env)
|
|
170
|
+
// delete extendedConfig.plugins
|
|
164
171
|
|
|
165
|
-
|
|
166
|
-
|
|
172
|
+
// const viteServer = await viteCreateServer(extendedConfig)
|
|
173
|
+
|
|
174
|
+
// return viteServer
|
|
175
|
+
// }
|
|
167
176
|
|
|
168
177
|
export const disableAppCache = (app) => {
|
|
169
178
|
app.set("etag", false)
|