Coder Social home page Coder Social logo

ideal-cli's Introduction

ideal-cli

Frontend cli

一、Features

  • Support build(Webpack)
    • development
    • production
    • library
  • code format
  • pre hooks check
  • standard version
  • dll
  • build analysis
  • browser compatibility
  • commit lint

Coming soon

  • Unit test(Jest)

二、Usages

npm i ideal-cli@latest -D -E

# First init configuration
npx ideal-cli init -h

三、Configurations

1. package.json

{
  "scripts": {
    "start": "ideal-cli start",
    "build": "ideal-cli build",
    "build-lib": "ideal-cli build-lib"
  }
}

2. browserslist

Add configuration to package.json

{
  "browserslist": [
    "> 1%",
    "not dead",
    "not op_mini all",
    "Firefox ESR",
    "Chrome >= 68",
    "IE 11",
    "Firefox >= 56",
    "Opera >= 48",
    "Safari >= 11"
  ]
}

3. babelrc

If project uses react, you should config local .babelrc:

{
  "presets": [
    "react-app"
  ]
}

4. lint

npx eslint --init
{
  "lint": "eslint 'src/**/*.[tj]s?(x)'",
  "lint-fix": "npm run lint -- --fix",
  "format": "prettier 'src/**/*.[tj]s?(x)' --check --write && npm run lint-fix"
}

5. version

major.minor.patch

npm run release -- --first-release
npm run release -- --release-as (major|minor|patch)

More Info

6. Dll

Config package.json

{
  "scripts": {
    "prestart": "rimraf dist && ideal-cli dll",
    "prebuild": "rimraf dist && ideal-cli dll"
  }
}

Config your index.html.

<body>
  <!-- contents -->

  <!-- Inject DLL -->
  <script src="%INJECT_DLL%"></script>
</body>

Config your project.config.js.

{
  dllVendors: ['react', 'react-dom']
}

四、Optimization

五、Bundle analysis

npm run analyze

Analysis Website

ideal-cli's People

Contributors

dependabot[bot] avatar taylorpzreal avatar

Watchers

 avatar  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.