Skip to content
This repository has been archived by the owner on Aug 16, 2022. It is now read-only.

kelreel/webpack-ts-sass-config

Repository files navigation


Webpack 4 TypeScript config

TypeScript, Babel, SASS, PostCSS...

This is my personal Webpack 4 config for single page (index.html) without frameworks. It will be updated as needed.

Installation

Clone this repository and install modules:

git clone https://github.com/kelreel/webpack-ts-sass-config.git
cd webpack-ts-sass-config
npm install

Commands

Run development mode

npm run start

Run build mode

npm run build

Features

  • 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)

Entry point

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
}