LANCommander/LANCommander.UI/webpack.config.js

62 lines
1.9 KiB
JavaScript
Raw Permalink Normal View History

2024-08-18 14:39:31 -05:00
const path = require('path');
2024-08-18 17:02:11 -05:00
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
2025-01-22 20:05:47 -06:00
const CopyWebpackPlugin = require('copy-webpack-plugin');
2024-08-18 14:39:31 -05:00
module.exports = {
2025-09-06 13:09:47 -05:00
entry: ['./Main.ts', './_Imports.razor.scss'], // Adjust the path if your index.js is located elsewhere
2024-08-18 15:25:31 -05:00
module: {
rules: [
{
test: /\.tsx?$/,
use: 'ts-loader',
exclude: /nodemodules/,
},
2024-08-18 17:02:11 -05:00
{
test: /\.(css)$/,
use: [
MiniCssExtractPlugin.loader,
{
loader: 'css-loader',
options: { sourceMap: true }
}
],
2024-08-18 17:02:11 -05:00
},
{
test: /\.s[ac]ss$/i,
use: [
MiniCssExtractPlugin.loader,
{
loader: 'css-loader',
options: { sourceMap: true }
},
{
loader: 'sass-loader',
options: { sourceMap: true }
}
],
2024-08-18 17:02:11 -05:00
}
2024-08-18 15:25:31 -05:00
],
},
resolve: {
extensions: ['.tsx', '.ts', '.js'],
},
2024-08-18 14:39:31 -05:00
output: {
filename: 'bundle.js', // The output file
2024-08-18 15:08:32 -05:00
path: path.resolve(__dirname, 'wwwroot'), // The output directory
2024-08-18 14:39:31 -05:00
},
2024-08-18 17:02:11 -05:00
plugins: [
new MiniCssExtractPlugin({
filename: "ui.css"
}),
2025-01-22 20:05:47 -06:00
new CopyWebpackPlugin({
patterns: [
{
from: path.resolve(__dirname, 'node_modules/bootstrap-icons/bootstrap-icons.svg'),
to: path.resolve(__dirname, 'wwwroot')
}
]
}),
2024-08-18 17:02:11 -05:00
],
2024-08-18 14:39:31 -05:00
mode: 'production', // Use 'production' for minified output
devtool: 'source-map'
2024-08-18 14:39:31 -05:00
};