@@ -157,6 +157,55 @@ function lorisModule(mname, entries, override=false) {
157157 } ;
158158}
159159
160+ const plugins = [
161+ new CopyPlugin ( {
162+ patterns : [
163+ {
164+ from : path . resolve ( __dirname , 'node_modules/react/umd' ) ,
165+ to : path . resolve ( __dirname , 'htdocs/vendor/js/react' ) ,
166+ flatten : true ,
167+ force : true ,
168+ globOptions : {
169+ ignore : [ 'react.profiling.min.js' ] ,
170+ } ,
171+ filter : async ( path ) => {
172+ const file = path . split ( '\\' ) . pop ( ) . split ( '/' ) . pop ( ) ;
173+ const keep = [
174+ 'react.development.js' ,
175+ 'react.production.min.js' ,
176+ ] ;
177+ return keep . includes ( file ) ;
178+ } ,
179+ } ,
180+ {
181+ from : path . resolve ( __dirname , 'node_modules/react-dom/umd' ) ,
182+ to : path . resolve ( __dirname , 'htdocs/vendor/js/react' ) ,
183+ flatten : true ,
184+ force : true ,
185+ filter : async ( path ) => {
186+ const file = path . split ( '\\' ) . pop ( ) . split ( '/' ) . pop ( ) ;
187+ const keep = [
188+ 'react-dom.development.js' ,
189+ 'react-dom.production.min.js' ,
190+ ] ;
191+ return keep . includes ( file ) ;
192+ } ,
193+ } ,
194+ ] ,
195+ } ) ,
196+ ] ;
197+
198+ mode == 'development' && plugins . push ( new ESLintPlugin ( {
199+ files : [
200+ 'modules/' ,
201+ 'jsx/' ,
202+ 'jslib/' ,
203+ 'htdocs/js/' ,
204+ 'webpack.config.js' ,
205+ ] ,
206+ cache : true ,
207+ } ) ) ;
208+
160209let config = [
161210 // Core components
162211 {
@@ -227,6 +276,7 @@ let config = [
227276 ] ,
228277 } ) ,
229278 ] ,
279+ plugins : plugins ,
230280 optimization : optimization ,
231281 resolve : resolve ,
232282 module : mod ,
0 commit comments