0.1.0 • Published 9 months ago

ljas-webpack v0.1.0

Weekly downloads
2
License
MIT
Repository
github
Last release
9 months ago

ljas-webpack

npm License

ljas-webpack is a library of webpack configuration parts. It was originally built for Lean JS App Starter (LJAS), but you may find it useful for your own webpack configurations.

Installation

npm install --save-dev ljas-webpack

ljas-webpack vs. Conventional webpack Configuration

When you compare a webpack config file written with ljas-webpack to an equivalent conventional one (like one you'd see in the webpack docs' "Getting Started" guide), you'll find that ljas-webpack drastically reduces clutter and makes the config code easier to understand at a high-level.

You can see this comparison yourself with a basic example that we have available for you to check out.

Usage

Although it's not required, we designed this library with the intention that it would be used with webpack-merge.

If you're unfamiliar with webpack-merge, its main purpose is to improve the composition and maintenance of webpack configurations. We highly recommended reading the "Composing Configuration" chapter in the SurviveJS webpack book, a free book by one of the founders of the webpack core team, Juho Vepsäläinen. This resource was actually the catalyst for this library.

You can also get an idea of how webpack-merge works by reading over its usage in the webpack docs' "Production" guide. It doesn't go over the concept of a configuration parts like SurviveJS does, but it does use webpack-merge to split the webpack config across separate files to improve maintainability.

The root of this repository will have various .js files that export functions available for you to import into your own webpack configs. Each function exported from these files will have a JSDoc comment that explains what it does and what packages it relies on.

Documentation & Examples

Besides reading the JSDoc comments in the source code, you can also view the HTML docs generated from them in the docs/ directory. You can also view the docs for the latest version of the library at: https://mattlean.github.io/lean-js-app-starter

If you would like to see some examples of webpack configs, check out the examples/ directory.

For more complicated examples, check out Lean JS App Starter's examples and starter projects.

License

ljas-webpack is open source software licensed as MIT.