sponge-hates-setting-up-small-js-projects
is an ES6 project template that is intended to provide the absolute minimum of setup for developing ES6-based JavaScript projects that run in modern browsers. It does not seek to provide anything beyond what is required to create and bundle a webapp using HTML, JS, and CSS. The lack of these extras doesn't indicate any real support against these concepts, but rather just the desire to have the smallest possible starting point. Extending the configuration and adding new modules is very much recommended.
What's Included
- Babel, configured with
babel-preset-env
and defaults. - Webpack, configured to provide the following:
- Clean the output directory.
- Copy all files from
static
to the bundle output. - HTML Webpack Plugin, configured by default for index.html
- Mini CSS Extract Plugin, configured to pack style.css with a hash for cache busting.
- JavaScript packing running through
babel-loader
, outputting a single script.js with a hash for cache busting.
- ESLint, using the ESLint Recommended preset with some light customization. No NPM scripts are included for ESLint, with the intent being that you'll use tools within editors for running ESLint. (I use Visual Studio Code's ESLint extension to manage this)
- NPM scripts for development server and packaging builds.
- .gitignore setup with GitHub JS defaults
No solutions are included for testing, templating, or CSS pre-processing. These can, however, easily be added to the dependencies through npm install --save
or --save-dev
. Clone the project, reset the git repo, and then run npm install
to install all the dependencies. Use npm start
to run a development server, and npm build
to output a bundled build to the dist
folder.