Skip to main content

NX

  • nrwl/nx
    • 大型仓库构建框架
  • 一个 workspace 为一个大项目 - @project
    • 项目下包含多个 app、lib、tool 为 project
    • 通过插件提供生成和构建执行能力
  • 参考
caution
  • 全局一个 package.json 而不是每个一个 #1777
npx create-nx-workspace --name demo --preset empty --packageManager npm --nx-cloud false
# 所有插件nx list
npm add -D @nrwl/next @nrwl/reactnpx nx g @nrwl/next:app demo
# import {} from '@myproject/mylibrary'npx nx generate @nrwl/react:library mylibrary --style styled-component --component false
npx nx g @nrwl/react:storybook-configuration project-namenpx nx run project-name:storybook

plugins#

pluginincludefor
@nrwl/webbuilders,generatorsWeb Component
@nrwl/reactgenerators
@nrwl/nestexecutors,generators
@nrwl/angulargenerators
@nrwl/nodeexecutors,generators
@nrwl/expressexecutors,generators
@nrwl/nextbuilders,generators
@nrwl/storybookbuilders,generators
@nrwl/cypressbuilders,generators
@nrwl/jestbuilders,generators
@nrwl/linterbuilders
@nrwl/workspacebuilders,generators
@nrwl/nx-pluginexecutors,generators
  • generator
    • app,application
    • c,component
    • component-story
    • lib,library
    • redux
    • stories
    • storybook-configuration
    • configuration
      • storybook
    • page
      • next
  • executor
    • build
    • server
    • export
    • dev-server
      • web
    • file-server
      • web
    • package
      • web