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) {
256256 // add filename in dev
257257 ( isProduction ? '' : ( '__vue_options__.__file = ' + JSON . stringify ( filePath ) ) ) + '\n'
258258
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+
259265 // add require for template
260266 var template = parts . template
261267 if ( template ) {
Original file line number Diff line number Diff line change @@ -107,6 +107,7 @@ describe('vue-loader', function () {
107107 test ( {
108108 entry : './test/fixtures/basic.vue'
109109 } , function ( window , module , rawModule ) {
110+ expect ( module . name ) . to . equal ( 'basic' )
110111 var vnode = mockRender ( module , {
111112 msg : 'hi'
112113 } )
You can’t perform that action at this time.
0 commit comments