File tree Expand file tree Collapse file tree 2 files changed +27
-1
lines changed Expand file tree Collapse file tree 2 files changed +27
-1
lines changed Original file line number Diff line number Diff line change @@ -213,7 +213,7 @@ module.exports = function (content) {
213213 }
214214 }
215215
216- var loader = options . extractCSS
216+ var loader = options . extractCSS && type === 'styles'
217217 ? loaders [ lang ] || getCSSExtractLoader ( lang )
218218 : loaders [ lang ]
219219
Original file line number Diff line number Diff line change @@ -166,6 +166,32 @@ describe('vue-loader', function () {
166166 } )
167167 } )
168168
169+ it ( 'pre-processors with extract css' , done => {
170+ test ( {
171+ entry : './test/fixtures/pre.vue' ,
172+ vue : {
173+ extractCSS : true
174+ } ,
175+ plugins : [
176+ new ExtractTextPlugin ( 'test.output.css' )
177+ ]
178+ } , ( window , module ) => {
179+ var vnode = mockRender ( module )
180+
181+ expect ( vnode . children [ 0 ] . tag ) . to . equal ( 'h1' )
182+ expect ( vnode . children [ 1 ] . tag ) . to . equal ( 'comp-a' )
183+ expect ( vnode . children [ 2 ] . tag ) . to . equal ( 'comp-b' )
184+
185+ expect ( module . data ( ) . msg ) . to . contain ( 'Hello from coffee!' )
186+
187+ var css = mfs . readFileSync ( '/test.output.css' ) . toString ( )
188+ css = normalizeNewline ( css )
189+ expect ( css ) . to . contain ( 'body {\n font: 100% Helvetica, sans-serif;\n color: #999;\n}' )
190+
191+ done ( )
192+ } )
193+ } )
194+
169195 it ( 'scoped style' , done => {
170196 test ( {
171197 entry : './test/fixtures/scoped-css.vue' ,
You can’t perform that action at this time.
0 commit comments