Giter VIP home page Giter VIP logo

starter-turbo's Introduction


子工程构建步骤

一、使用 cli 构建模版


二、【可选】项目配置 eslint

2.1 安装 eslint @lousanpang/eslint-config

cd apps/web/[projectName]
pnpm add eslint -D
pnpm add @lousanpang/eslint-config -D --workspace

2.2 创建 eslint.config.mjs 配置文件

// eslint.config.mjs
import antfu from '@lousanpang/eslint-config'

export default antfu

2.3 package.json 配置

// package.json
{
  "scripts": {
    "lint": "eslint .",
    "lint:fix": "eslint . --fix"
  },
  "devDependencies": {
    "@lousanpang/eslint-config": "workspace:*",
    "eslint": "^9.9.1"
  }
}

2.4 使用

pnpm lint:fix

三、【可选】项目配置 typescript

3.1 安装 typescript @lousanpang/typescript-config

cd apps/web/[projectName]
pnpm add typescript -D
pnpm add @lousanpang/typescript-config -D --workspace

3.2 添加 tsconfig.json

// tsconfig.json
{
  "extends": "@lousanpang/typescript-config/base.json",
  "compilerOptions": {
    "outDir": "dist",
    "rootDir": "src"
  },
  "include": [
    "src"
  ],
  "exclude": [
    "node_modules",
    "dist"
  ]
}

四、【可选】项目配置 UI 组件库

import Counter from '@lousanpang/ui/counter'

<Counter />

五、【可选】项目配置 request 请求拦截库


六、【可选】项目配置 utils 工具库

6.1 安装 @lousanpang/utils

cd apps/web/[projectName]
pnpm add @lousanpang/utils -D --workspace

6.2 使用 @lousanpang/utils 工具库

import { add } from '@lousanpang/utils/add'

add(1, 2)

starter-turbo's People

Contributors

lousanpang avatar

Watchers

 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.