Skip to content
Merged
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
15 changes: 15 additions & 0 deletions packages/venia-concept/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ const HTMLWebpackPlugin = require('html-webpack-plugin');
const webpack = require('webpack');
const fs = require('fs');
const { promisify } = require('util');
const path = require('path');

const {
getMediaURL,
Expand Down Expand Up @@ -72,6 +73,20 @@ module.exports = async env => {
({ store_code }) => store_code === process.env.STORE_VIEW_CODE
);

/**
* Here we check the STORE_VIEW_CODE for multistore setup and generate
* the index.html content to have the store code in script url
* and placed the assets in storeview specific folder inside dist
*/
if (process.env.USE_STORE_CODE_IN_URL && process.env.STORE_VIEW_CODE) {
const storeViewCode = process.env.STORE_VIEW_CODE;
config.output = {
...config.output,
publicPath: `/${storeViewCode}/`,
path: path.resolve(__dirname, 'dist', storeViewCode)
};
}

global.MAGENTO_MEDIA_BACKEND_URL = mediaUrl;
global.LOCALE = storeConfigData.locale.replace('_', '-');
global.AVAILABLE_STORE_VIEWS = availableStores;
Expand Down
Loading