mirror of
https://github.com/Rezmason/matrix.git
synced 2026-04-14 12:29:30 -07:00
55 lines
1.1 KiB
JavaScript
55 lines
1.1 KiB
JavaScript
const webpack = require("webpack");
|
|
const path = require("path");
|
|
const HtmlWebpackPlugin = require("html-webpack-plugin");
|
|
|
|
module.exports = {
|
|
mode: "development",
|
|
entry: path.resolve(__dirname, "./js/index.js"),
|
|
module: {
|
|
rules: [
|
|
{
|
|
test: /\.(js|jsx)$/,
|
|
exclude: /node_modules/,
|
|
use: ["babel-loader"],
|
|
},
|
|
{
|
|
test: /\.css$/,
|
|
use: ["style-loader", "css-loader"],
|
|
},
|
|
{
|
|
test: /\.(png|j?g|svg|gif)?$/,
|
|
type: "asset/resource",
|
|
},
|
|
{
|
|
test: /\.(glsl|frag|vert|wgsl)$/i,
|
|
exclude: /node_modules/,
|
|
use: ["raw-loader"],
|
|
},
|
|
],
|
|
},
|
|
resolve: {
|
|
extensions: ["*", ".js", ".jsx"],
|
|
},
|
|
output: {
|
|
path: path.resolve(__dirname, "./dist"),
|
|
filename: "[name].bundle.js",
|
|
clean: true,
|
|
},
|
|
devtool: "inline-source-map",
|
|
plugins: [
|
|
new HtmlWebpackPlugin({
|
|
template: path.resolve(__dirname, "public/index.html"),
|
|
filename: "index.html",
|
|
}),
|
|
new webpack.HotModuleReplacementPlugin(),
|
|
],
|
|
devServer: {
|
|
historyApiFallback: true,
|
|
static: path.resolve(__dirname, "./dist"),
|
|
compress: true,
|
|
hot: true,
|
|
open: true,
|
|
port: 3000,
|
|
},
|
|
};
|