Skip to content

fx-adr/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/kanitelk/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
}

About

Webpack 4: TypeScript, Babel, SCC/SASS, PostCSS, hashing and images

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 60.0%
  • HTML 26.4%
  • CSS 12.9%
  • TypeScript 0.7%