chatchat/webpack.config.js

40 lines
787 B
JavaScript
Raw Permalink Normal View History

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