create-webpack-app is a cli tool that enables developers to scaffold a new webpack project quickly. It provides developers with a flexible set of commands to increase speed when setting up a custom webpack project. webpack CLI addresses these needs by providing tools to improve the setup of custom webpack configuration.
It also supports several front-end frameworks and libraries like React, Vue, Svelte and pure project.
Webpack Loader and Plugin scaffolding is also supported.
Supported arguments and commands
Usage
npx create-webpack-app [command] [options]
Commands
init (also used by default when nothing specified) - project generator
loader - loader generator
plugin - plugin generator
CLI options
To generate default template
npx create-webpack-app
To generate with default answers
npx create-webpack-app -f
or
npx create-webpack-app --force
To generate in a specified path
npx create-webpack-app [generation-path]
To generate a project according to a template
npx create-webpack-app --template <template-name>
Available templates:
default (used by default when nothing specified) - generate a basic template for JS(TS)/CSS/HTML without any frameworks
Every template scaffolds index.html as the entry point of the project and relies on
webpack's built-in HTML and CSS support (webpack >= 5.109), so the generated projects
carry no html-webpack-plugin, css-loader, style-loader or mini-css-extract-plugin.
Picking Sass, Less, Stylus or PostCSS adds only that tool's loader on top.
Available templates for loader and plugin generators:
default (used by default when nothing specified) - generate bootstrap code