| 
3 | 3 | 
 
  | 
4 | 4 | const EmberApp = require('ember-cli/lib/broccoli/ember-app');  | 
5 | 5 | const { Webpack } = require('@embroider/webpack');  | 
6 |  | -// const { RetryChunkLoadPlugin } = require('webpack-retry-chunk-load-plugin');  | 
7 |  | -// const TerserPlugin = require('terser-webpack-plugin');  | 
 | 6 | +const { RetryChunkLoadPlugin } = require('webpack-retry-chunk-load-plugin');  | 
 | 7 | +const TerserPlugin = require('terser-webpack-plugin');  | 
8 | 8 | // const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer');  | 
9 | 9 | 
 
  | 
10 | 10 | module.exports = async function (defaults) {  | 
@@ -79,41 +79,40 @@ module.exports = async function (defaults) {  | 
79 | 79 |     },  | 
80 | 80 |   });  | 
81 | 81 | 
 
  | 
82 |  | -  // const embroiderOptions = {  | 
83 |  | -  //   staticAddonTestSupportTrees: true,  | 
84 |  | -  //   staticAddonTrees: true,  | 
85 |  | -  //   staticHelpers: true,  | 
86 |  | -  //   staticComponents: true,  | 
87 |  | -  //   splitAtRoutes: [  | 
88 |  | -  //     /about/,  | 
89 |  | -  //     /contact/,  | 
90 |  | -  //     /debuggery/,  | 
91 |  | -  //     // 'error', don't ever split the error route, it will break error handling  | 
92 |  | -  //     /links/,  | 
93 |  | -  //     /messages/,  | 
94 |  | -  //     /music/,  | 
95 |  | -  //   ],  | 
96 |  | -  //   packagerOptions: {  | 
97 |  | -  //     webpackConfig: {  | 
98 |  | -  //       plugins: [new RetryChunkLoadPlugin() /*, new BundleAnalyzerPlugin()*/],  | 
99 |  | -  //       devtool: env === 'production' ? 'source-map' : 'eval',  | 
100 |  | -  //       optimization: {  | 
101 |  | -  //         minimize: true,  | 
102 |  | -  //         minimizer: [  | 
103 |  | -  //           new TerserPlugin({  | 
104 |  | -  //             terserOptions: {  | 
105 |  | -  //               compress: {  | 
106 |  | -  //                 passes: 6, // slow, but worth it  | 
107 |  | -  //                 inline: 5,  | 
108 |  | -  //                 reduce_funcs: false,  | 
109 |  | -  //               },  | 
110 |  | -  //             },  | 
111 |  | -  //           }),  | 
112 |  | -  //         ],  | 
113 |  | -  //       },  | 
114 |  | -  //     },  | 
115 |  | -  //   },  | 
116 |  | -  // };  | 
 | 82 | +  const embroiderOptions = {  | 
 | 83 | +    staticAddonTestSupportTrees: true,  | 
 | 84 | +    staticAddonTrees: true,  | 
 | 85 | +    staticInvokables: true,  | 
 | 86 | +    // splitAtRoutes: [  | 
 | 87 | +    //   /about/,  | 
 | 88 | +    //   /contact/,  | 
 | 89 | +    //   /debuggery/,  | 
 | 90 | +    //   // 'error', don't ever split the error route, it will break error handling  | 
 | 91 | +    //   /links/,  | 
 | 92 | +    //   /messages/,  | 
 | 93 | +    //   /music/,  | 
 | 94 | +    // ], disabled until https://github.com/embroider-build/embroider/issues/231 once again allows our loading routes to work  | 
 | 95 | +    packagerOptions: {  | 
 | 96 | +      webpackConfig: {  | 
 | 97 | +        plugins: [new RetryChunkLoadPlugin() /*, new BundleAnalyzerPlugin()*/],  | 
 | 98 | +        devtool: env === 'production' ? 'source-map' : 'eval',  | 
 | 99 | +        optimization: {  | 
 | 100 | +          minimize: true,  | 
 | 101 | +          minimizer: [  | 
 | 102 | +            new TerserPlugin({  | 
 | 103 | +              terserOptions: {  | 
 | 104 | +                compress: {  | 
 | 105 | +                  passes: 6, // slow, but worth it  | 
 | 106 | +                  inline: 5,  | 
 | 107 | +                  reduce_funcs: false,  | 
 | 108 | +                },  | 
 | 109 | +              },  | 
 | 110 | +            }),  | 
 | 111 | +          ],  | 
 | 112 | +        },  | 
 | 113 | +      },  | 
 | 114 | +    },  | 
 | 115 | +  };  | 
117 | 116 | 
 
  | 
118 |  | -  return require('@embroider/compat').compatBuild(app, Webpack);  | 
 | 117 | +  return require('@embroider/compat').compatBuild(app, Webpack, embroiderOptions);  | 
119 | 118 | };  | 
0 commit comments