const path = require("path");
|
|
const webpack = require("webpack");
|
|
|
|
module.exports = {
|
|
devServer: {
|
|
port: 9000,
|
|
static: {
|
|
directory: path.join(__dirname, "dist"),
|
|
},
|
|
},
|
|
devtool: "inline-source-map",
|
|
entry: ["./lib/index.ts"],
|
|
mode: process.env.NODE_ENV === "production" ? "production" : "development",
|
|
module: {
|
|
rules: [
|
|
{
|
|
test: /\.ts$/,
|
|
exclude: /node_modules/,
|
|
use: "ts-loader",
|
|
},
|
|
{
|
|
test: /\.(frag|vert)$/,
|
|
type: "asset/source",
|
|
},
|
|
],
|
|
},
|
|
output: {
|
|
path: path.join(__dirname, "dist", "build"),
|
|
publicPath: "/build",
|
|
filename: "bundle.js",
|
|
},
|
|
performance: {
|
|
maxEntrypointSize: 512000,
|
|
maxAssetSize: 512000,
|
|
},
|
|
plugins: [new webpack.EnvironmentPlugin({ NODE_ENV: "development" })],
|
|
resolve: {
|
|
extensions: [".js", ".ts"],
|
|
},
|
|
};
|