TypeScript, Babel, SASS, PostCSS...
This is my personal Webpack 4 config for single page (index.html) without frameworks. It will be updated as needed.
Clone this repository and install modules:
git clone https://github.com/kelreel/webpack-ts-sass-config.git
cd webpack-ts-sass-config
npm install
Run development mode
npm run start
Run build mode
npm run build
- TypeScript
- Babel
- CSS/SASS + PostCSS (CSSnano, autoprefixer) + Normilize
- Hashing
- Assets folder for Production
- Minifying JS & CSS
- Two .js chunks - main.js and vendor.js (modules)
Webpack.config.js
{
entry: { main: "./src/index.ts" }, // Entry Point
output: {
path: path.resolve(__dirname, "docs"), // Output folder (Production)
filename: "[name].[chunkhash].js",
pathinfo: false
}