Giter Site home page Giter Site logo

react-app-w5's Introduction

手写 react typescript 脚手架

安装

yarn install

构建

yarn build

疑问

1.关于图片以及其他静态资源引用

使用 webpack5 asset/module
https://webpack.docschina.org/guides/asset-modules/

2.关于持久化缓存

https://www.jianshu.com/p/4e810ca6c132
cache: {
  type: "filesystem", // 使用文件缓存
  // cacheDirectory 默认路径是 node_modules/.cache/webpack
  // cacheDirectory: path.resolve(__dirname, "./temp_cache") //本地目录
  // 缓存依赖,当缓存依赖修改时,缓存失效
  buildDependencies: {
    // 将你的配置添加依赖,更改配置时,使得缓存失效
    config: [__filename]
  }
}

3.关于状态管理

mobx + mobx-react
https://zh.mobx.js.org/react-integration.html

4.关于 tsx

既可以使用 babel-loader
也可以使用 ts-loader

react-app-w5's People

Contributors

leiliugrandstream avatar

Watchers

Cherish_Meng avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.