这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@nddery
Copy link
Contributor

@nddery nddery commented May 29, 2017

Pass in this as ctx to the API, which reference the updated native ES module. There seems to be a reference to the module in module.__proto__.exports.a but (1) it seems weird to use that, and (2) it doesn't work with it as it doesn't have the beforeCreate and al. hooks from vue-hot-reload-api. Not sure ctx is the best name for that variable but.. that's what I got.

ref: #7

// babel did not transform modules
// eslint-disable-next-line no-underscore-dangle
component = module.__esModule ? module.default : module;
component = ctx.__esModule ? ctx.default : ctx;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From my tests there was always a default property on the object (even if that's all that's being exported), so maybe we could just drop this and test for default ? Not sure what to do when there are no default and only named exports ?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a good question. I guess we should just take care of the default export (I think that's how vue-loader works, too).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, you're right, that's what they (vue-loader) seem to do. But is it *.vue files that don't support named export or vue-hot-reload-api that doesn't like it or something ?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess it's not supported because there's no way to determine what's a Vue object or something completely unrelated.

@skyrpex skyrpex merged commit 6af82ff into skyrpex:master May 30, 2017
@skyrpex
Copy link
Owner

skyrpex commented May 30, 2017

Perfect! Now it really works. Thank you so much.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants