Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
remove hot-reload hack code because of vuejs/vue-loader#1569
- Loading branch information
baitu.huang
committed
Jul 19, 2019
1 parent
0546611
commit f9a58ae
Showing
5 changed files
with
5 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,13 @@ | ||
const loaderUtils = require('loader-utils') | ||
const { RESOLVED_FLAGS_PATH, IF_FLAG } = require('./constants') | ||
const ifDirReg = new RegExp(`\\s${IF_FLAG}(?:\\s*(=)\\s*(?:"([^"]+)"+|'([^']+)'+|([^\\s"'=<>\`]+)))`) | ||
// const hotReloadRegs = [/module\.hot\.accept\(/, /module\.hot\.data/, /vue/] | ||
|
||
module.exports = function vueFlagsTemplateLoader (source, map) { | ||
// let vue, type | ||
// const { watch } = loaderUtils.getOptions(this) | ||
// if (!watch) { | ||
// return this.callback(null, source, map) | ||
// } | ||
if (this.resourceQuery) { | ||
const { vue, type } = loaderUtils.parseQuery(this.resourceQuery) | ||
if (vue && type === 'template' && ifDirReg.test(source)) { | ||
this.addDependency(RESOLVED_FLAGS_PATH) | ||
} | ||
} | ||
// if (!type && this.hot && hotReloadRegs.every(r => r.test(source))) { | ||
// // create component hot reload record by removing `module.hot.data`, see `vue-hot-reload-api` | ||
// source = 'module.hot && module.hot.data && module.hot.data.__vue_component_hot__ && (module.hot.data = undefined);\n' + source | ||
// } | ||
this.callback(null, source, map) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters