Skip to content
This repository was archived by the owner on Jul 14, 2022. It is now read-only.

Support for static url #721

Merged
merged 4 commits into from
Sep 29, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion config/webpack/config.base.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const path = require("path");
if (!process.env.API_URI) {
throw new Error("Environment variable API_URI not set");
}
const STATIC_URL = process.env.STATIC_URL || '/';

module.exports = ({ sourceDir, distDir }) => ({
devtool: "source-map",
Expand Down Expand Up @@ -84,7 +85,7 @@ module.exports = ({ sourceDir, distDir }) => ({
},
output: {
path: distDir,
publicPath: "/",
publicPath: STATIC_URL,
},
plugins: [
new CleanWebpackPlugin({
Expand Down
3 changes: 2 additions & 1 deletion config/webpack/config.prod.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
const MiniCssExtractPlugin = require("mini-css-extract-plugin");


module.exports = ({ sourceDir, distDir }) => ({
output: {
filename: "js/[name].[contenthash].js"
filename: "js/[name].[contenthash].js",
},
module: {
rules: [
Expand Down