Files
2022-08-26 03:52:29 +03:00

43 lines
1.1 KiB
JavaScript

const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
module.exports = {
target: 'web',
mode: 'development',
output: {
path: path.resolve(__dirname, 'dist')
},
module: {
rules: [
{
test: /\.css$/i,
use: [
MiniCssExtractPlugin.loader,
'css-loader'
]
},
{
test: /\.ts$/,
use: {
loader: require.resolve('babel-loader'),
options: {
presets: [
'@babel/preset-typescript'
]
}
}
}
]
},
plugins: [
new MiniCssExtractPlugin(),
new HtmlWebpackPlugin({
template: path.resolve(__dirname, 'index.html')
})
],
entry: {
main: path.resolve(__dirname, 'src/main.ts')
}
};