project/webpack.config.js
2025-04-26 11:18:10 +03:00

34 lines
713 B
JavaScript

const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
module.exports = {
entry: './src/index.tsx',
output: {
filename: 'index.js',
path: path.resolve(__dirname, 'dist'),
clean: true,
},
resolve: {
extensions: ['.js', '.ts', '.jsx', '.tsx'],
},
module: {
rules: [
{ test: /\.(ts|tsx)$/, loader: 'ts-loader' },
{
test: /\.hbs|html$/,
loader: 'handlebars-loader'``,
},
{
test: /\.css$/i,
use: [{ loader: 'style-loader' }, { loader: 'css-loader' }],
},
],
},
plugins: [
new HtmlWebpackPlugin({
template: './src/index.html',
filename: 'index.html',
}),
],
};