import { join , resolve } from 'path' ; import { Configuration } from 'webpack' ; import * as HtmlWebpackPlugin from 'html-webpack-plugin' ; const config = { mode : 'development' , entry : resolve ( __dirname , 'src/main.ts' ) , module : { rules : [ { test : /\.ts?$/ , loader : 'ts-loader' } , ] , } , resolve : { extensions : [ '.ts' , '.js' ] , } , output : { path : resolve ( __dirname , 'dist' ) , filename : 'bundle.js' , } , plugins : [ new HtmlWebpackPlugin ( { template : resolve ( __dirname , 'src/index.html' ) , } ) , ] , devServer : { contentBase : join ( __dirname , 'lib' ) , compress : true , port : 4200 , } , } ; export default config ;