1
0
Fork 0
VaultUI/webpack-dev.config.js

65 lines
1.4 KiB
JavaScript
Raw Normal View History

const path = require('path');
const webpack = require('webpack');
var os = require("os");
const HtmlWebpackPlugin = require('html-webpack-plugin');
const { GitRevisionPlugin } = require('git-revision-webpack-plugin');
const gitRevisionPlugin = new GitRevisionPlugin();
let commitHash = gitRevisionPlugin.commithash();
module.exports = {
mode: "development",
cache: true,
2021-05-24 09:48:13 +01:00
entry: './src/main.tsx',
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'bundle.js',
publicPath: '/',
},
stats: {
colors: true,
timings: true,
},
plugins: [
new HtmlWebpackPlugin({ title: "VaultUI" }),
new webpack.DefinePlugin({
BUILD_STRING:
JSON.stringify(`Built At: ${new Date().toString()} by ${os.userInfo().username}@${os.hostname()} on commit ${commitHash}`),
})
],
devServer: {
open: process.env.BROWSER,
historyApiFallback: true,
},
resolve: {
modules: ['node_modules'],
extensions: ['.tsx', '.ts', '.js', ".mjs"],
2022-01-13 18:09:03 +00:00
alias: {os: false}
},
module: {
rules: [
2022-01-11 10:57:30 +00:00
{
assert: { type: "css" },
loader: "css-loader",
options: {
exportType: "string",
},
},
{
test: /\.(sa|sc|c)ss$/,
use: [
"sass-loader"
],
},
{
test: /\.ts(x?)$/,
use: [
{
loader: 'ts-loader'
}
]
},
],
},
};