@@ -19,6 +19,7 @@ const __dirname = path.dirname(__filename);
1919const projectRoot = path . normalize ( path . join ( __dirname , '..' , '..' ) ) ;
2020
2121const isProduction = process . env . NODE_ENV === 'production' ;
22+ const browserDistDir = 'dist/browser' ;
2223
2324// Configuration shared by both node and browser builds
2425const baseConfig = {
@@ -68,7 +69,7 @@ export const mainBundleConfig = {
6869 sourcemap : true ,
6970 splitting : true ,
7071 entryPoints : [ 'src/index.tsx' ] ,
71- outdir : 'dist' ,
72+ outdir : browserDistDir ,
7273 metafile : true ,
7374 publicPath : '/' ,
7475 entryNames : '[name]-[hash]' ,
@@ -90,14 +91,14 @@ export const mainBundleConfig = {
9091 copy ( {
9192 resolveFrom : projectRoot ,
9293 assets : [
93- { from : [ 'res/_headers' ] , to : [ 'dist' ] } ,
94- { from : [ 'res/_redirects' ] , to : [ 'dist' ] } ,
95- { from : [ 'res/contribute.json' ] , to : [ 'dist' ] } ,
96- { from : [ 'res/robots.txt' ] , to : [ 'dist' ] } ,
97- { from : [ 'res/service-worker-compat.js' ] , to : [ 'dist' ] } ,
98- { from : [ 'res/img/favicon.png' ] , to : [ 'dist /res/img' ] } ,
99- { from : [ 'docs-user/**/*' ] , to : [ 'dist /docs' ] } ,
100- { from : [ 'locales/**/*' ] , to : [ 'dist /locales' ] } ,
94+ { from : [ 'res/_headers' ] , to : [ browserDistDir ] } ,
95+ { from : [ 'res/_redirects' ] , to : [ browserDistDir ] } ,
96+ { from : [ 'res/contribute.json' ] , to : [ browserDistDir ] } ,
97+ { from : [ 'res/robots.txt' ] , to : [ browserDistDir ] } ,
98+ { from : [ 'res/service-worker-compat.js' ] , to : [ browserDistDir ] } ,
99+ { from : [ 'res/img/favicon.png' ] , to : [ ` ${ browserDistDir } /res/img` ] } ,
100+ { from : [ 'docs-user/**/*' ] , to : [ ` ${ browserDistDir } /docs` ] } ,
101+ { from : [ 'locales/**/*' ] , to : [ ` ${ browserDistDir } /locales` ] } ,
101102 ] ,
102103 } ) ,
103104 generateHtmlPlugin ( {
@@ -122,7 +123,7 @@ export const photonConfig = {
122123 sourcemap : true ,
123124 publicPath : '/photon/' ,
124125 entryPoints : [ 'res/photon/index.js' ] ,
125- outdir : 'dist /photon' ,
126+ outdir : ` ${ browserDistDir } /photon` ,
126127 metafile : true ,
127128 plugins : [
128129 generateHtmlPlugin ( {
0 commit comments