isoflow/webpack/standalone.config.js
2024-04-01 22:34:46 +01:00

45 lines
1.1 KiB
JavaScript

const path = require('path');
const HtmlWebPackPlugin = require('html-webpack-plugin');
const TsconfigPathsPlugin = require('tsconfig-paths-webpack-plugin');
const webpack = require('webpack');
module.exports = {
mode: 'production',
entry: './src/index.tsx',
target: 'web',
output: {
path: path.resolve(__dirname, '../dist'),
filename: '[name].js',
},
module: {
rules: [
{
test: /\.(ts|tsx)$/,
use: 'ts-loader',
exclude: /node_modules/
},
{
test: /\.css$/i,
use: ['style-loader', 'css-loader']
},
{
test: /\.svg$/i,
type: 'asset/inline'
}
]
},
plugins: [
new HtmlWebPackPlugin({
template: path.resolve(__dirname, '../src/index.html')
}),
new webpack.DefinePlugin({
PACKAGE_VERSION: JSON.stringify(require("../package.json").version),
REPOSITORY_URL: JSON.stringify(require("../package.json").repository.url),
})
],
resolve: {
extensions: ['.tsx', '.ts', '.js'],
plugins: [new TsconfigPathsPlugin()]
}
};