File tree Expand file tree Collapse file tree 2 files changed +7
-0
lines changed Expand file tree Collapse file tree 2 files changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -256,6 +256,12 @@ module.exports = function (content) {
256
256
// add filename in dev
257
257
( isProduction ? '' : ( '__vue_options__.__file = ' + JSON . stringify ( filePath ) ) ) + '\n'
258
258
259
+ // add component name based on the filename
260
+ exports +=
261
+ 'if(typeof __vue_options__.name === "undefined") {\n' +
262
+ ' __vue_options__.name = ' + JSON . stringify ( path . parse ( filePath ) . name ) + '\n' +
263
+ '}'
264
+
259
265
// add require for template
260
266
var template = parts . template
261
267
if ( template ) {
Original file line number Diff line number Diff line change @@ -107,6 +107,7 @@ describe('vue-loader', function () {
107
107
test ( {
108
108
entry : './test/fixtures/basic.vue'
109
109
} , function ( window , module , rawModule ) {
110
+ expect ( module . name ) . to . equal ( 'basic' )
110
111
var vnode = mockRender ( module , {
111
112
msg : 'hi'
112
113
} )
You can’t perform that action at this time.
0 commit comments