confetti_starter_kit is a webpack configured to create modern javascript web applications with confetti support.
This starter kit could be installed in 2 ways.
- Clone this repository and start working on the main branch.
- Using degit.
git clone https://github.com/dev-enforced/confetti-starter-kit.git
cd confetti-starter-kit
npm install
npm install -g degit
Follow the below instructions to use this starter kit:
degit dev-enforced/confetti-starter-kit#main my-app-name
cd my-app-name
npm install
# to start your application in localhost:3000
using npm --> npm run start
using yarn --> yarn start
This application contains the following dependencies provided by wepack.
- Babel
- CSS support
- Assets (images)
- Code Splitting
- Caching
- HTML optimisation
Has an extra feature in addition to the above:
- Confetti Launch feature on button click.
The toolkit provides out of the box caching functionalities which are implemented in the following two ways:
- Using
[contenthash]
to cache bundle files. - Extracting & caching non-changing third party libraries into vendor bundles.
- Webpack provides a way to use filename substitutions to insert hashes of the file content using
[contenthash]
in the filename to cache files that don't change after a build of your app. This is leveraged in the toolkit to cache bundles by default and this behavior can be changed by updating thewebpack.config.common.js
file.
- By default, the toolkit splits and extracts third party
npm
libraries intovendor
chunks as these are less likely to change than the source code of your app. This is done using thecacheGroups
option of theSplitChunksPlugin
inwebpack.config.common.js
- Run using
npm start
which will create a live server with hot-reload. - To build and generate files in the development mode, run the following command after local setup:
npm run build-dev
. - This generates the build files within
./dist
folder but they will not be minified.
- Run
npm run build
, this'll combine and create adist
with the resulted code for deployment. - This generates the build files within ./dist folder and they will be minified.