ice icon indicating copy to clipboard operation
ice copied to clipboard

为什么我在引用defineDataLoader之后,热加载的时间就会增加。

Open anyone0034 opened this issue 1 year ago • 1 comments

Describe the bug

为什么我在引用defineDataLoader之后,热加载的时间就会增加。如果不引用,平时1s完成热加载,引入之后,就变成7、8s

Expected behavior

热加载的时间,能在正常的范围内。

Actual behavior

import { defineDataLoader, Await, useData, history } from 'ice';

export const dataLoader = defineDataLoader(async () => { return { nickname: "", }; });

Version of ice.js

"devDependencies": { "@applint/spec": "^1.2.3", "@ice/app": "^3.3.9", "@ice/plugin-auth": "^1.0.2", "@ice/plugin-request": "^1.0.2", "@ice/plugin-store": "^1.1.2", "@types/babel__core": "^7", "@types/node": "^20.10.6", "@types/react": "^18.2.46", "@types/react-dom": "^18.2.18", "@types/speed-measure-webpack-plugin": "^1", "eslint": "^8.56.0", "stylelint": "^16.1.0", "typescript": "^5.3.3" },

Content of build.json or ice.config.mts

import { defineConfig } from '@ice/app';
import request from '@ice/plugin-request';
import store from '@ice/plugin-store';
import auth from '@ice/plugin-auth';
const minify = process.env.NODE_ENV === 'production' ? 'swc' : false;
export default defineConfig(() => ({
    
    compileDependencies: true,
    htmlGenerating: true,
    
    
    ssg: false,
    minify,
    plugins: [
        request(),
        store(),
        auth(),
        
    ],
    
    routes: {
        defineRoutes: (route) => {
            
            
        },
    },
    
}));

Additional context

No response

anyone0034 avatar Jan 22 '24 11:01 anyone0034

能不能提供个复现 demo 供排查

ClarkXia avatar Jan 22 '24 11:01 ClarkXia

Fixed in #6804

ClarkXia avatar Feb 28 '24 07:02 ClarkXia