Airpack is a Webpack-CLI wrapper. Designed to make using Webpack more elegant.

Airpack patches Webpack-CLI with enhancements when Node loads the Webpack-CLI module. This patch allows Webpack-CLI to automatically read Webpack configurations from multiple locations (project dependencies, project directories, command-line arguments) in a prioritized order, and then merge these Webpack configurations in a more appropriate way.

When using airpack, your package.json should look like this:

{ "scripts": { "dev": "NODE_ENV=development airpack --server", "build": "NODE_ENV=production airpack"}, "devDependencies": {"@arzyu/webpack-config-web": "^0.1.3", "airpack": "^" 1.0.1, "webpack - cli" : "^ 4.7.2", "webpack - dev - server" : "^ 3.11.2"},}
  • npm run dev, start the local development service (callwebpack serve)
  • npm run build, run packaging (callwebpack)

There are many benefits to using the Webpack configuration in this way:

  • The project directory is cleaner, with only project-related logic, not any.babelrc.*,postcss.config.js,.eslintrc.*And… Or even need notwebpack.config.*. Templating the project will be more convenient. See sample projects:arzyu/react-webpack-playground.
  • Use lessdevDependencies, the length of the dependency list has been shortened from an arm to a finger, and all Webpack configuration related dependencies are placed separatelywebpack-config-*In the package.
  • Use stand-alonewebpack-config-*Packages are easier to manage, versioning, iteration, and sharing are easier. It is more appropriate to publish the package to your own or your organization’s name, as shown in the example configuration:@arzyu/webpack-config-web. Complex configurations can also be split into multiple packages, which Airpack can merge for you.

More details, please click project warehouses refer to: https://github.com/arzyu/airpack