use public path

This commit is contained in:
Sasha 2025-06-02 18:52:25 +02:00
parent df759c6075
commit e277355121
No known key found for this signature in database
2 changed files with 5 additions and 1 deletions

View File

@ -3,7 +3,7 @@
"version": "0.0.1",
"private": true,
"scripts": {
"build": "NODE_ENV='production' webpack --config webpack.config.js --mode production",
"build": "NODE_ENV=production webpack --config webpack.config.js --mode production",
"start": "webpack-dev-server"
},
"dependencies": {

View File

@ -1,11 +1,15 @@
const CopyWebpackPlugin = require("copy-webpack-plugin");
const path = require("path");
const isProduction = process.env.NODE_ENV === 'production';
const publicPath = isProduction ? '/dogfooding/' : '/';
module.exports = {
entry: "./src/index.ts",
output: {
path: path.resolve(__dirname, "build"),
filename: "index.js",
publicPath: publicPath,
},
experiments: {
asyncWebAssembly: true,