File tree Expand file tree Collapse file tree 1 file changed +14
-10
lines changed
Expand file tree Collapse file tree 1 file changed +14
-10
lines changed Original file line number Diff line number Diff line change 22 MIT License http://www.opensource.org/licenses/mit-license.php
33 Author Tobias Koppers @sokra
44*/
5- function LoaderTargetPlugin ( target ) {
6- this . target = target ;
5+ "use strict" ;
6+
7+ class LoaderTargetPlugin {
8+ constructor ( target ) {
9+ this . target = target ;
10+ }
11+
12+ apply ( compiler ) {
13+ let target = this . target ;
14+ compiler . plugin ( "compilation" , ( compilation ) => {
15+ compilation . plugin ( "normal-module-loader" , ( loaderContext ) => loaderContext . target = target ) ;
16+ } ) ;
17+ }
718}
19+
820module . exports = LoaderTargetPlugin ;
9- LoaderTargetPlugin . prototype . apply = function ( compiler ) {
10- var target = this . target ;
11- compiler . plugin ( "compilation" , function ( compilation ) {
12- compilation . plugin ( "normal-module-loader" , function ( loaderContext ) {
13- loaderContext . target = target ;
14- } ) ;
15- } ) ;
16- } ;
You can’t perform that action at this time.
0 commit comments