File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -446,6 +446,28 @@ describe('loader and plugin', () => {
446446 assets [ 'main.js' ] . source ( ) . should . contain ( `__webpack_require__.p + "${ spriteFilename } ` ) ;
447447 } ) ;
448448
449+ it ( 'should generate asset with output path without changing publicPath' , async ( ) => {
450+ const publicPath = '/olala/' ;
451+ const spriteFilename = defaultSpriteFilename ;
452+
453+ const v4Config = { } ;
454+ if ( webpackVersion . IS_4 ) {
455+ v4Config . mode = 'development' ;
456+ v4Config . devtool = false ;
457+ }
458+
459+ const { assets } = await compile ( Object . assign ( v4Config , {
460+ entry : './entry' ,
461+ output : { publicPath } ,
462+ module : rules (
463+ svgRule ( { extract : true , spriteFilename, outputPath : '/foo/' } )
464+ ) ,
465+ plugins : [ new SpritePlugin ( ) ]
466+ } ) ) ;
467+
468+ assets [ 'main.js' ] . source ( ) . should . contain ( `__webpack_require__.p + "${ spriteFilename } ` ) ;
469+ } ) ;
470+
449471 it ( 'should emit only built chunks' , ( ) => {
450472 // TODO test with webpack-recompilation-emulator
451473 } ) ;
You can’t perform that action at this time.
0 commit comments