File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ const HTMLWebpackPlugin = require('html-webpack-plugin');
3
3
const webpack = require ( 'webpack' ) ;
4
4
const fs = require ( 'fs' ) ;
5
5
const { promisify } = require ( 'util' ) ;
6
+ const path = require ( 'path' ) ;
6
7
7
8
const {
8
9
getMediaURL,
@@ -72,6 +73,20 @@ module.exports = async env => {
72
73
( { store_code } ) => store_code === process . env . STORE_VIEW_CODE
73
74
) ;
74
75
76
+ /**
77
+ * Here we check the STORE_VIEW_CODE for multistore setup and generate
78
+ * the index.html content to have the store code in script url
79
+ * and placed the assets in storeview specific folder inside dist
80
+ */
81
+ if ( process . env . USE_STORE_CODE_IN_URL && process . env . STORE_VIEW_CODE ) {
82
+ const storeViewCode = process . env . STORE_VIEW_CODE ;
83
+ config . output = {
84
+ ...config . output ,
85
+ publicPath : `/${ storeViewCode } /` ,
86
+ path : path . resolve ( __dirname , 'dist' , storeViewCode )
87
+ } ;
88
+ }
89
+
75
90
global . MAGENTO_MEDIA_BACKEND_URL = mediaUrl ;
76
91
global . LOCALE = storeConfigData . locale . replace ( '_' , '-' ) ;
77
92
global . AVAILABLE_STORE_VIEWS = availableStores ;
You can’t perform that action at this time.
0 commit comments