@@ -3,6 +3,7 @@ const CommonsChunkPlugin = require('webpack/lib/optimize/CommonsChunkPlugin');
33const HtmlPlugin = require ( 'html-webpack-plugin' ) ;
44
55const { isWebpack1 } = require ( '../lib/utils' ) ;
6+ const webpackVersion = require ( '../lib/utils/get-webpack-version' ) ;
67const { loaderPath, fixturesPath } = require ( './_config' ) ;
78const {
89 rule,
@@ -274,6 +275,36 @@ describe('loader and plugin', () => {
274275 } ) ;
275276 } ) ;
276277
278+ // webpack 3 scope hoisting interop
279+ if ( webpackVersion . IS_3 ) {
280+ // eslint-disable-next-line global-require
281+ const ModuleConcatenationPlugin = require ( 'webpack/lib/optimize/ModuleConcatenationPlugin' ) ;
282+
283+ describe ( 'webpack ModuleConcatenationPlugin interop' , ( ) => {
284+ it ( 'should work' , async ( ) => {
285+ const spriteFilename = 'qwe.svg' ;
286+ const { assets } = await compile ( {
287+ entry : './entry-es6-import' ,
288+ module : rules (
289+ svgRule ( { extract : true , spriteFilename } )
290+ ) ,
291+ plugins : [
292+ new SpritePlugin ( ) ,
293+ new ModuleConcatenationPlugin ( )
294+ ]
295+ } ) ;
296+
297+ Object . keys ( assets ) . should . be . lengthOf ( 2 ) ;
298+ assets . should . have . property ( spriteFilename ) ;
299+ } ) ;
300+
301+ // TODO
302+ it ( 'should properly interpolate [chunkname]' , ( ) => {
303+
304+ } ) ;
305+ } ) ;
306+ }
307+
277308 it ( 'should automatically detect modules to extract' , async ( ) => {
278309 const { assets } = await compile ( {
279310 entry : './entry' ,
0 commit comments