File tree Expand file tree Collapse file tree 2 files changed +2
-25
lines changed Expand file tree Collapse file tree 2 files changed +2
-25
lines changed Original file line number Diff line number Diff line change @@ -254,7 +254,7 @@ module.exports = function (content) {
254
254
// unknown lang, infer the loader to be used
255
255
switch ( type ) {
256
256
case 'template' :
257
- return defaultLoaders . html + '!' + templatePreprocessorPath + '?raw& engine=' + lang + '!'
257
+ return defaultLoaders . html + '!' + templatePreprocessorPath + '?engine=' + lang + '!'
258
258
case 'styles' :
259
259
loader = addCssModulesToLoader ( defaultLoaders . css , part , index )
260
260
return loader + '!' + styleCompiler + ensureBang ( ensureLoader ( lang ) )
Original file line number Diff line number Diff line change 2
2
3
3
var cons = require ( 'consolidate' )
4
4
var loaderUtils = require ( 'loader-utils' )
5
- var extname = require ( 'path' ) . extname
6
5
7
6
module . exports = function ( content ) {
8
7
this . cacheable && this . cacheable ( )
9
8
var callback = this . async ( )
10
9
var opt = loaderUtils . getOptions ( this ) || { }
11
10
12
- // this is never documented and should be deprecated
13
- // but we'll keep it so we don't break stuff
14
- var vue = this . options . __vueOptions__
15
- if ( vue && vue . template ) {
16
- for ( var key in vue . template ) {
17
- opt [ key ] = vue . template [ key ]
18
- }
19
- }
20
-
21
- function exportContent ( content ) {
22
- if ( opt . raw ) {
23
- callback ( null , content )
24
- } else {
25
- callback ( null , 'module.exports = ' + JSON . stringify ( content ) )
26
- }
27
- }
28
-
29
- // with no engine given, use the file extension as engine
30
- if ( ! opt . engine ) {
31
- opt . engine = extname ( this . request ) . substr ( 1 ) . toLowerCase ( )
32
- }
33
-
34
11
if ( ! cons [ opt . engine ] ) {
35
12
return callback ( new Error (
36
13
'Template engine \'' + opt . engine + '\' ' +
@@ -45,6 +22,6 @@ module.exports = function (content) {
45
22
if ( err ) {
46
23
return callback ( err )
47
24
}
48
- exportContent ( html )
25
+ callback ( null , html )
49
26
} )
50
27
}
You can’t perform that action at this time.
0 commit comments