1
0
mirror of https://github.com/akpaevj/onecmonitor.git synced 2024-12-14 10:12:52 +02:00
onecmonitor/onecmonitor-server/webpack.config.js
akpaev.e 7e803de335 +
2023-01-28 00:27:52 +03:00

57 lines
1.4 KiB
JavaScript

const path = require('path');
const webpack = require('webpack');
const { CleanWebpackPlugin } = require("clean-webpack-plugin");
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
module.exports = {
entry: {
script: [
'./Scripts/site.ts'
]
},
mode: 'development',
devtool: 'inline-source-map',
optimization: {
minimize: false,
usedExports: false
},
module: {
rules: [
{
test: /\.tsx?$/,
loader: 'ts-loader',
options: {
transpileOnly: true
}
},
{
test: /\.css$/i,
use: [
MiniCssExtractPlugin.loader,
"css-loader"
]
},
],
},
resolve: {
extensions: ['.tsx', '.ts', '.js'],
},
output: {
library: {
name: "OM",
type: "var"
},
filename: 'dist/app.js',
path: path.resolve(__dirname, 'wwwroot'),
},
plugins: [
new CleanWebpackPlugin({
cleanOnceBeforeBuildPatterns: ["dist"]
}),
new MiniCssExtractPlugin({
filename: "css/site.css",
}),
new webpack.ContextReplacementPlugin(/moment[/\\]locale$/, /en|ru/)
],
};