Skip to content
This repository was archived by the owner on Dec 26, 2018. It is now read-only.
This repository was archived by the owner on Dec 26, 2018. It is now read-only.

Option to disable hotReload #238

Open
@stevendesu

Description

@stevendesu

Hot module reloading breaks source maps in development. Here is an example App.vue file:

<template>
    <div id="app">
        <h1>Test</h1>
    </div>
</template>

<script>
export default {};
</script>

<style lang="scss">
#app {
    text-align: center;
    h1 {
        color: #f00;
    }
}
</style>

When I build my app for production (process.env === "production") my sourcemap looks perfect. When I build my app for development, however, I get the following:

screenshot from 2018-09-17 14-57-30

This turns debugging into guess-and-check as I can no longer find the exact line in my code where an error is being thrown. Admittedly it's very rapid guess-and-check thanks to hot module reloading, but I'd prefer to just refresh the page after every change and have my original, untainted source files.

Looking at compiler.js I imagine this would only require making a change to line 156. Change:

if (!isProduction && !isTest && !isServer) {

to:

if (!isProduction && !isTest && !isServer && options.hotReload) {

I'm not sure where default options are configured in the Vueify source code, but after this change you would just want to set the default for hotReload to true (allowing someone to override it with false). This way people like me who would rather not use hot module reloading in development can still make use of Vueify.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions