File tree Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -85,9 +85,10 @@ module.exports = class SpikeWebpackPlugin {
8585 if ( dep . _outputMultiple ) {
8686 // if we have an outputMultiple flag, that means more than one
8787 // output (shocking, i know)
88- const sources = JSON . parse ( src )
88+ const sources = JSON . parse ( String ( src ) )
8989 for ( let k in sources ) {
90- const multiOutPath = outputPath . replace ( / \. h t m l / , `.${ k } .html` )
90+ let multiOutPath = k
91+ if ( ! k . match ( / \. h t m l $ / ) ) multiOutPath += '.html'
9192 compilation . assets [ multiOutPath ] = {
9293 source : ( ) => { return sources [ k ] } ,
9394 size : ( ) => { return sources [ k ] . length }
Original file line number Diff line number Diff line change @@ -4,13 +4,13 @@ const fs = require('fs')
44const exp = require ( 'reshape-expressions' )
55const { compileFixture} = require ( './_helpers' )
66
7- test ( 'emits compile errors correctly' , ( t ) => {
7+ test ( 'compiles multi output templates correctly' , ( t ) => {
88 return compileFixture ( t , 'multi' , {
99 reshape : {
1010 plugins : [ exp ( ) ] ,
1111 multi : [
12- { locals : { greeting : 'hello' } , name : 'en' } ,
13- { locals : { greeting : 'hola' } , name : 'es ' }
12+ { locals : { greeting : 'hello' } , name : 'index. en' } ,
13+ { locals : { greeting : 'hola' } , name : 'index.es.html ' }
1414 ]
1515 }
1616 } ) . then ( ( { res, publicPath} ) => {
You can’t perform that action at this time.
0 commit comments