Files
browser-wakatime/webpack.config.ts
2021-01-15 21:18:11 -06:00

32 lines
737 B
TypeScript

import * as path from 'path';
import * as webpack from 'webpack';
import { CleanWebpackPlugin } from 'clean-webpack-plugin';
export default (): webpack.Configuration[] => {
const cfgs: webpack.Configuration[] = [];
const chromeExtCfg: webpack.Configuration = {
entry: {
app: [path.join(__dirname, 'src', 'app.tsx')],
},
module: {
rules: [
{
test: /\.(js|jsx|ts|tsx)$/,
use: 'ts-loader',
},
],
},
output: {
filename: '[name].js',
path: path.join(__dirname, 'dist', 'chrome'),
},
plugins: [new CleanWebpackPlugin()],
resolve: {
extensions: ['.js', '.jsx', '.ts', '.tsx'],
},
};
cfgs.push(chromeExtCfg);
return cfgs;
};