You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
tailchat/web/webpack.config.ts

36 lines
716 B
TypeScript

/**
* Reference: https://webpack.js.org/configuration/configuration-languages/
*/
import { Configuration } from 'webpack';
import path from 'path';
const ROOT_PATH = path.resolve(__dirname, './');
const DIST_PATH = path.resolve(ROOT_PATH, './dist');
const ASSET_PATH = process.env.ASSET_PATH || '/';
const config: Configuration = {
entry: {
app: './src/index.tsx',
},
output: {
path: DIST_PATH,
filename: '[name].[contenthash].js',
publicPath: ASSET_PATH,
},
module: {
rules: [
{
test: /\.tsx?$/,
use: 'esbuild-loader',
exclude: /node_modules/,
},
],
},
resolve: {
extensions: ['.tsx', '.ts', '.js'],
},
};
export default config;