From e27735512136e72a4eb4e8fb0eaaadbb764208d7 Mon Sep 17 00:00:00 2001 From: Sasha Date: Mon, 2 Jun 2025 18:52:25 +0200 Subject: [PATCH] use public path --- examples/dogfooding/package.json | 2 +- examples/dogfooding/webpack.config.js | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/examples/dogfooding/package.json b/examples/dogfooding/package.json index e30e9f7..e4f7f3e 100644 --- a/examples/dogfooding/package.json +++ b/examples/dogfooding/package.json @@ -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": { diff --git a/examples/dogfooding/webpack.config.js b/examples/dogfooding/webpack.config.js index 6a4d646..5762d37 100644 --- a/examples/dogfooding/webpack.config.js +++ b/examples/dogfooding/webpack.config.js @@ -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,