@@ -11,7 +11,7 @@ const isDevMode =
|
||||
/** 小程序/H5 请求的后端 origin(不含 /api);本地默认本机,生产构建默认远程 */
|
||||
const API_ORIGIN =
|
||||
process.env.VITE_API_TARGET ??
|
||||
(isDevMode ? 'http://localhost:3010' : 'https://api.dukanghaoke.com');
|
||||
(isDevMode ? 'http://192.168.1.10:3010' : 'https://api.dukanghaoke.com');
|
||||
|
||||
const requireFromApp = createRequire(path.resolve(__dirname, '../package.json'));
|
||||
|
||||
@@ -42,7 +42,7 @@ export default defineConfig(async () => ({
|
||||
},
|
||||
sourceRoot: 'src',
|
||||
outputRoot: 'dist',
|
||||
plugins: ['@tarojs/plugin-framework-react', '@tarojs/plugin-html'],
|
||||
plugins: ['@tarojs/plugin-framework-react'],
|
||||
alias: {
|
||||
// 指向包目录(不是 index.js),否则 react-dom/client 会变成 index.js/client
|
||||
react: REACT_DIR,
|
||||
@@ -98,6 +98,9 @@ export default defineConfig(async () => ({
|
||||
mini: {
|
||||
/** dev:weapp 预览模式需开启,否则 React hooks 在 Vite 下会失效 */
|
||||
debugReact: isDevMode,
|
||||
optimizeMainPackage: {
|
||||
enable: true,
|
||||
},
|
||||
postcss: {
|
||||
pxtransform: { enable: true, config: {} },
|
||||
cssModules: { enable: false },
|
||||
|
||||
Reference in New Issue
Block a user