@@ -7,7 +7,14 @@ const TerserPlugin = require('terser-webpack-plugin');
77
88const FIXTURE_PATH = 'temp/fixtures/' ;
99
10+ /**
11+ *
12+ * @param {{[entryName:string]:{entryPath:string, includeStats:boolean}} } entries
13+ * @param {string } packageName
14+ * @returns
15+ */
1016function createWebpackConfig ( entries , packageName ) {
17+ const normalizedPkgName = packageName . replace ( '@fluentui/' , '' ) ;
1118 return Object . keys ( entries ) . map ( entryName => {
1219 /** @type {BundleAnalyzerPlugin.Options } */
1320 let anaylizerPluginOptions = {
@@ -53,6 +60,10 @@ function createWebpackConfig(entries, packageName) {
5360 entry : {
5461 [ entryName ] : entryPath ,
5562 } ,
63+ output : {
64+ filename : `[name].min.js` ,
65+ path : path . resolve ( __dirname , 'dist' , normalizedPkgName ) ,
66+ } ,
5667 externals : {
5768 react : 'React' ,
5869 'react-dom' : 'ReactDOM' ,
@@ -130,6 +141,9 @@ function createFluentReactFixtures() {
130141 } ) ;
131142}
132143
144+ /**
145+ * @param {string } packageName
146+ */
133147function createEntry ( packageName ) {
134148 try {
135149 // import everything from a single package
@@ -145,11 +159,13 @@ function createEntry(packageName) {
145159/**
146160 * Build webpack entries from created fixtures.
147161 *
162+ * @param {string } packageName
163+ * @param {{[entryName:string]:{entryPath:string, includeStats:boolean}} } [entries]
148164 * @param {boolean } [includeStats] - Stats are generated and used by the size auditor report
149- * to check more details on what caused the bundle size change. Due to stats generation being slow,
150- * and therefore slowing down CI significantly, setting this to true to avoid stats generation.
151- * If bundle size is changed unexpectedly, developers can drill down deeper on the problem by
152- * locally running bundle tests.
165+ to check more details on what caused the bundle size change. Due to stats generation being slow,
166+ and therefore slowing down CI significantly, setting this to true to avoid stats generation.
167+ If bundle size is changed unexpectedly, developers can drill down deeper on the problem by
168+ locally running bundle tests.
153169 */
154170function buildEntries ( packageName , entries = { } , includeStats = true ) {
155171 const folderName = getFolderName ( packageName ) ;
@@ -169,6 +185,8 @@ function buildEntries(packageName, entries = {}, includeStats = true) {
169185
170186/**
171187 * Build entries for single fixture with top level import.
188+ * @param {string } packageName
189+ * @param {boolean } [includeStats]
172190 */
173191function buildEntry ( packageName , includeStats = true ) {
174192 const folderName = getFolderName ( packageName ) ;
@@ -179,6 +197,9 @@ function buildEntry(packageName, includeStats = true) {
179197 } ;
180198}
181199
200+ /**
201+ * @param {string } packageName
202+ */
182203function getFolderName ( packageName ) {
183204 return packageName . replace ( '@fluentui/' , '' ) ;
184205}
0 commit comments