My personal Webpack config.
Start development mode.
Some plugin would not work in development mode to fasten the compiler.
Start production build
Run and execute all plugins.
Note: Satisfy the compiler first before starting to build mode. It would not successfully compile your lifes work if there is a mistake or an error.
Prettify your code in src
folder
Prettify your files from base folder
Linter your TypeScript code
Execute linter to check for other problem from your TypeScript code.
Add :fix
at the end of the command to fix some issue that are fixable
Linter your stylesheet code
Similar to npm run eslint
but for stylesheet
- Open
webpack.config.mjs
and search for// REPLACE
to see all parameters that you might need to change per project. - Replace icon from
src/assets/icon.png
with your app icon. - Place your
favicon.ico
icon intopublic
folder - MAKE SURE TO REPLACE GOOGLE MEASUREMENT ID OR REMOVE THE PLUGIN IF YOU DON'T HAVE IT
- All files from
public
folder will be minified (if possible) and copied to dist folder. - Update your
package.json
file. - Use atleast 1024x1024px icon for your
icon.png
- Use 16x16px icon for your
favicon.ico
Automatically update your HTML contents by using this keys
Key | Description |
---|---|
%TITLE% | Your project name from package.json |
%APP_VERSION% | Project version from package.json |
%APP_MODE% | Project mode. (development |
%BASE_URL% | Project homepage from package.json |
%CURRENT_YEAR% | Year when project has been build |
%CURRENT_DATE% | Date when project has been build |
%APP_REPOSITORY% | Project repository link from package.json |
- Modify project dependencies only if needed
- PLACE YOUR OWN GOOGLE MEASUREMENT ID or REMOVE THE PLUGIN
- Automatically produce
site.webmanifest
base on your inputs - Automatically resize your icon from
src/assets/icon.png
into different sizes it needs - Automatically update every code changes. Restart required when modifying webpack config
- Uses Typescript, Sass for yoyr project
- Automatically inject Google Tag Manager in build mode
- Automatically insert Open Graph, Twitter and some meta data that helps other platform such as Facebook, Google and Twitter
- Just try to use it see other features. I am not sure what I have done with it.