Skip to content

Commit

Permalink
temp
Browse files Browse the repository at this point in the history
  • Loading branch information
longshuicy committed Aug 19, 2024
1 parent fb4dba9 commit 204a14f
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
2 changes: 1 addition & 1 deletion frontend/src/index.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
rel="stylesheet"
href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&display=swap"
/>
<link href="<%= htmlWebpackPlugin.options.publicPath %>/styles/main.css" rel="stylesheet">
<link href="<%= htmlWebpackPlugin.options.publicPath %>styles/main.css" rel="stylesheet">

<title>Clowder v2</title>
</head>
Expand Down
10 changes: 7 additions & 3 deletions frontend/webpack.config.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ export default {
target: "web",
output: {
path: path.resolve(__dirname, "dist"),
publicPath: "",
publicPath: process.env.BASE_URL_ROUTE
? `${process.env.BASE_URL_ROUTE}/`
: "/", // Ensure trailing slash
filename: "[name].bundle.js",
chunkFilename: "[name].chunk.bundle.js",
},
Expand All @@ -58,13 +60,15 @@ export default {
new webpack.HotModuleReplacementPlugin(),
new HtmlWebpackPlugin({
template: "src/index.ejs",
favicon: "./src/public/favicon.ico",
favicon: "src/public/favicon.ico",
minify: {
removeComments: true,
collapseWhitespace: true,
},
inject: true,
publicPath: process.env.BASE_URL_ROUTE || "", // Ensure paths are prefixed correctly
publicPath: process.env.BASE_URL_ROUTE
? `${process.env.BASE_URL_ROUTE}/`
: "/", // Ensure trailing slash
}),
new webpack.LoaderOptionsPlugin({
debug: true,
Expand Down
8 changes: 6 additions & 2 deletions frontend/webpack.config.prod.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ export default {
filename: "[name].bundle.js",
chunkFilename: "[name].chunk.bundle.js",
path: path.resolve(__dirname, "dist"),
publicPath: process.env.BASE_URL_ROUTE || "", // Set the public path for all assets
publicPath: process.env.BASE_URL_ROUTE
? `${process.env.BASE_URL_ROUTE}/`
: "/", // Ensure trailing slash
},
plugins: [
// NOTE: `npm run preinstall` currently runs eslint
Expand Down Expand Up @@ -83,7 +85,9 @@ export default {
// Note that you can add custom options here if you need to handle other custom logic in index.html
// To track JavaScript errors via TrackJS, sign up for a free trial at TrackJS.com and enter your token below.
trackJSToken: "",
publicPath: process.env.BASE_URL_ROUTE || "", // Ensure paths are prefixed correctly
publicPath: process.env.BASE_URL_ROUTE
? `${process.env.BASE_URL_ROUTE}/`
: "/", // Ensure trailing slash
}),

new webpack.LoaderOptionsPlugin({
Expand Down

0 comments on commit 204a14f

Please sign in to comment.