Exploring ways to preserve the vanilla JS browser demo without compromising on the bundle. Experimenting with embedding images in the bundle as data URIs

This commit is contained in:
Rezmason
2025-05-06 12:59:02 -07:00
parent 6663c92f99
commit eea341f50c
27 changed files with 372 additions and 137 deletions

View File

@@ -1,6 +1,7 @@
const webpack = require("webpack");
const path = require("path");
const HtmlWebpackPlugin = require("html-webpack-plugin");
const CopyPlugin = require("copy-webpack-plugin");
module.exports = {
mode: "development",
@@ -12,19 +13,14 @@ module.exports = {
exclude: /node_modules/,
use: ["babel-loader"],
},
// {
// test: /\.css$/,
// use: ["style-loader", "css-loader"],
// },
{
test: /\.css$/,
use: ["style-loader", "css-loader"],
},
{
test: /\.(png|j?g|svg|gif)?$/,
test: /\.(png|jpe?g|svg|glsl|wgsl)?$/,
type: "asset/resource",
},
{
test: /\.(glsl|frag|vert|wgsl)$/i,
exclude: /node_modules/,
use: ["raw-loader"],
},
],
},
resolve: {
@@ -41,6 +37,12 @@ module.exports = {
template: path.resolve(__dirname, "public/index.html"),
filename: "index.html",
}),
new CopyPlugin({
patterns: [
{ from: "assets", to: "assets" },
{ from: "shaders", to: "shaders" },
],
}),
new webpack.HotModuleReplacementPlugin(),
],
devServer: {