vuejs / vue-hot-reload-api

🌶️ Hot reload API for Vue components
MIT License
466 stars 51 forks source link

fix: support non-browser environments #71

Closed janvennemann closed 6 years ago

janvennemann commented 6 years ago

Summary Fallback to add the record map to the global object if window is not available.

Motivation / Use Case I'm working on https://github.com/appcelerator/titanium-vue that allows the usage of Vue.js to create native mobile apps using Axway Titanium. This change is required to support hot reloading in our non-browser environment. Normal browser environments shouldn't be affected by this change.

// EDIT: similar to #70 but instead of initializing window, fallback to global which actually refers to the global var in most non-browser environments.