Node.js must be installed on your computer, otherwise download and install it.
Run this followed commands in Terminal :
- Clone this repository, you can specified your project name (optional)
git clone https://github.com/seyhajin/webpack-project-template <project_name>
- Install project dependencies (only for first time)
npm install
Edit title in index.html.
Your code must be placed in the src/ directory.
All public resources must be placed in the static/ directory.
Application entry point for javascript is in src/index.js.
Run development server in Terminal:
npm run dev
Your browser will open automatically on http://localhost:8080.
When you modify your code, the server refresh your browser.
When your project was ready for exporting to production, run the following command in Terminal :
npm run build
This command was generated optimised files on build/ directory.
Push them into your production server and enjoy 😀
mkdir <project_name> && cd <project_name>
mkdir src && mkdir static
npm init -y
npm install --save-dev @babel/core @babel/preset-env portfinder-sync internal-ip@6.2.0 webpack webpack-cli webpack-merge webpack-dev-server babel-loader css-loader file-loader html-loader raw-loader style-loader clean-webpack-plugin html-webpack-plugin copy-webpack-plugin mini-css-extract-plugin terser-webpack-plugin javascript-obfuscator webpack-obfuscator
Update package.json
, bundler/common.js
, bundler/dev.js
, bundler/prod.js
files.
Create .gitignore
in root directory and .gitkeep
in static directory.