@@ -3,11 +3,8 @@ import NativeModule from 'module';
3
3
import path from 'path' ;
4
4
5
5
import loaderUtils from 'loader-utils' ;
6
- import NodeTemplatePlugin from 'webpack/lib/node/NodeTemplatePlugin ' ;
6
+ import webpack from 'webpack' ;
7
7
import NodeTargetPlugin from 'webpack/lib/node/NodeTargetPlugin' ;
8
- import LibraryTemplatePlugin from 'webpack/lib/LibraryTemplatePlugin' ;
9
- import SingleEntryPlugin from 'webpack/lib/SingleEntryPlugin' ;
10
- import LimitChunkCountPlugin from 'webpack/lib/optimize/LimitChunkCountPlugin' ;
11
8
import validateOptions from 'schema-utils' ;
12
9
13
10
import CssDependency from './CssDependency' ;
@@ -84,13 +81,15 @@ export function pitch(request) {
84
81
outputOptions
85
82
) ;
86
83
87
- new NodeTemplatePlugin ( outputOptions ) . apply ( childCompiler ) ;
88
- new LibraryTemplatePlugin ( null , 'commonjs2' ) . apply ( childCompiler ) ;
84
+ new webpack . node . NodeTemplatePlugin ( outputOptions ) . apply ( childCompiler ) ;
85
+ new webpack . LibraryTemplatePlugin ( null , 'commonjs2' ) . apply ( childCompiler ) ;
89
86
new NodeTargetPlugin ( ) . apply ( childCompiler ) ;
90
- new SingleEntryPlugin ( this . context , `!!${ request } ` , pluginName ) . apply (
87
+ new webpack . SingleEntryPlugin ( this . context , `!!${ request } ` , pluginName ) . apply (
88
+ childCompiler
89
+ ) ;
90
+ new webpack . optimize . LimitChunkCountPlugin ( { maxChunks : 1 } ) . apply (
91
91
childCompiler
92
92
) ;
93
- new LimitChunkCountPlugin ( { maxChunks : 1 } ) . apply ( childCompiler ) ;
94
93
95
94
childCompiler . hooks . thisCompilation . tap (
96
95
`${ pluginName } loader` ,
@@ -210,7 +209,7 @@ export function pitch(request) {
210
209
locals
211
210
) } ;`
212
211
: esModule
213
- ? `export {};`
212
+ ? `\nexport {};`
214
213
: '' ;
215
214
216
215
let resultSource = `// extracted by ${ pluginName } ` ;
0 commit comments