当前位置: 首页 > 网络应用技术

webpack(v5.7)+react(v18.0)+react-router(v6.3)+mobx(v6.5)+ts(v4.6)

时间:2023-03-07 10:51:04 网络应用技术

  首先找到土地,挖一个坑

  module.exports = {“ @img”:path.resolve(dirname,'https://www.shouxicto.com/src/assets/images'),“ @svg”:path.resolve(dirname,'https:/https:///www.shouxicto.com/src/assets/svg'),“ @pages”:path.resolve(dirname,'https://www.shouxicto.com/src/pages'),“ @store” @store”。“ @Routes”:path.resolve(dirname,'https://www.shouxicto.com/src/routes'),},}

  module.exports = {模式:'开发',devserver:{client:{//编译错误或警告时,在浏览器中显示全屏幕覆盖范围。browser.progress:false,//告诉dev-server它应该尝试再次连接到客户端。当时,它将无限制地尝试。reconnect:true,},//启用GZIP压缩压缩:true,port,端口:9000,//启用WebPack模块热替换的模块热:true,//在服务器打开默认浏览器打开时,请告诉dev-server:true,// agent,//代理---处理交叉域转发代理:{{

  }

  树木摇动是一个通常用来描述在JavaScript中删除前所未有的代码的术语。这取决于ES2015模块语法的静态结构特征

  具体的详细代码视图

  module.exports = {is_dev,app_env,file_extensions}

  导出默认类用户{ /**

  constructor(){ /**

  导出默认storecontext;

  const root = reactdom.createroot(Docume

  root.render(

  );`` - 验证:使用````````````````````````react-router-dom'''从“@Router/index”导入路由;导入{usestore@hooks/storehook'import {tojs}从'mobx'

  函数app(){const {usestore} = usestore();userstore.settoken('ttt')console.log(tojs(userStore),'store- = - = - = - =',userstore)usertes(routes)(路由)(路由)

  导出默认应用程序;

  原始:https://juejin.cn/post/7094900059493367845