Skip to content
This repository has been 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 3 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
7 changes: 4 additions & 3 deletions 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 @@ -42,7 +43,7 @@ module.exports = ({ sourceDir, distDir }) => ({
options: {
name: "[name].[ext]",
outputPath: "fonts/",
publicPath: "/fonts/",
publicPath: STATIC_URL+"fonts/",
marianoeramirez marked this conversation as resolved.
Show resolved Hide resolved
},
},
],
Expand All @@ -55,7 +56,7 @@ module.exports = ({ sourceDir, distDir }) => ({
options: {
name: "[name].[ext]",
outputPath: "images/",
publicPath: "/images/",
publicPath: STATIC_URL+"images/",
marianoeramirez marked this conversation as resolved.
Show resolved Hide resolved
},
},
{
Expand Down Expand Up @@ -84,7 +85,7 @@ module.exports = ({ sourceDir, distDir }) => ({
},
output: {
path: distDir,
publicPath: "/",
publicPath: STATIC_URL,
marianoeramirez marked this conversation as resolved.
Show resolved Hide resolved
},
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