chatchat/webpack.config.js

40 lines
787 B
JavaScript

const HtmlWebpackPlugin = require('html-webpack-plugin');
const path = require('path');
module.exports = {
entry: {
app: ['whatwg-fetch', 'core-js/stable', './src/index.ts'],
},
devtool: 'source-map',
module: {
rules: [
{
test: /\.ts$/,
use: 'babel-loader',
exclude: /node_modules/,
},
{
test: /\.css$/,
use: ['style-loader', 'css-loader'],
},
{
test: /\.(woff|woff2|eot|ttf|otf)$/,
use: 'file-loader',
},
],
},
resolve: {
extensions: [ '.tsx', '.ts', '.js' ],
},
output: {
filename: 'main.js',
path: path.resolve(__dirname, 'dist'),
},
target: ["web", "es5"],
plugins: [new HtmlWebpackPlugin()],
devServer: {
contentBase: './dist',
},
};