File tree Expand file tree Collapse file tree 1 file changed +13
-11
lines changed Expand file tree Collapse file tree 1 file changed +13
-11
lines changed Original file line number Diff line number Diff line change @@ -91,28 +91,30 @@ async function setAliases(configurations, { allModules }) {
91
91
* @returns {Promise<string> }
92
92
*/
93
93
async function setPlugins ( configurations , { allModules } ) {
94
- return new Promise ( ( resolve ) => {
95
- configurations . forEach ( ( configuration ) => {
96
- if ( configuration . plugins ) {
97
- const { name, plugins } = configuration ;
94
+ await Promise . all (
95
+ configurations
96
+ . filter ( ( configuration ) => configuration . plugins )
97
+ . map ( ( { name, plugins } ) => {
98
98
const moduleName = name . replace ( / [ ^ a - z A - Z ] / g, '' ) ;
99
99
100
- plugins . forEach ( async ( { ssr, src } ) => {
100
+ return plugins . map ( ( { ssr, src } ) => {
101
101
const pluginPath = join (
102
102
allModules . find ( ( m ) => m . name === name ) . path ,
103
103
src ,
104
104
) . replace ( / \/ $ / g, '' ) ;
105
105
106
- await this . addPlugin ( {
106
+ return this . addPlugin ( {
107
107
src : `${ pluginPath } .js` ,
108
108
fileName : join ( 'modules' , moduleName , `${ src } .js` ) ,
109
- ssr,
109
+ options : {
110
+ mode : ssr ? 'server' : 'client' ,
111
+ } ,
110
112
} ) ;
111
113
} ) ;
112
- }
113
- } ) ;
114
- resolve ( 'All plugins set' ) ;
115
- } ) ;
114
+ } ) ,
115
+ ) ;
116
+
117
+ return 'All plugins set' ;
116
118
}
117
119
118
120
/**
You can’t perform that action at this time.
0 commit comments