Skip to content

Commit fc978bd

Browse files
authored
feat(dogfooding): make app use public path (#132)
1 parent dc935bc commit fc978bd

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

examples/dogfooding/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"version": "0.0.1",
44
"private": true,
55
"scripts": {
6-
"build": "NODE_ENV='production' webpack --config webpack.config.js --mode production",
6+
"build": "NODE_ENV=production webpack --config webpack.config.js --mode production",
77
"start": "webpack-dev-server"
88
},
99
"dependencies": {

examples/dogfooding/webpack.config.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
const CopyWebpackPlugin = require("copy-webpack-plugin");
22
const path = require("path");
33

4+
const isProduction = process.env.NODE_ENV === 'production';
5+
const publicPath = isProduction ? '/dogfooding/' : '/';
6+
47
module.exports = {
58
entry: "./src/index.ts",
69
output: {
710
path: path.resolve(__dirname, "build"),
811
filename: "index.js",
12+
publicPath: publicPath,
913
},
1014
experiments: {
1115
asyncWebAssembly: true,

0 commit comments

Comments
 (0)