Frontend cli
- Support build(Webpack)
- development
- production
- library
- code format
- pre hooks check
- standard version
- dll
- build analysis
- browser compatibility
- commit lint
- Unit test(Jest)
npm i ideal-cli@latest -D -E
# First init configuration
npx ideal-cli init -h
{
"scripts": {
"start": "ideal-cli start",
"build": "ideal-cli build",
"build-lib": "ideal-cli build-lib"
}
}
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"
]
}
If project uses react, you should config local .babelrc
:
{
"presets": [
"react-app"
]
}
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"
}
major.minor.patch
npm run release -- --first-release
npm run release -- --release-as (major|minor|patch)
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']
}
- code splitting
- lazy loading
- tree shaking
- Shimming
- Cache
- Concurrency
npm run analyze
Analysis Website