Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vue-loader
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
pi-plusplus
fork-from-github
vue-loader
Commits
fb1306e6
Commit
fb1306e6
authored
Mar 22, 2018
by
Evan You
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: properly stringify hot-reload-api path for Windows
parent
c6727838
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
+5
-5
hotReload.js
lib/codegen/hotReload.js
+3
-3
styleInjection.js
lib/codegen/styleInjection.js
+2
-2
No files found.
lib/codegen/hotReload.js
View file @
fb1306e6
const
hotReloadAPIPath
=
require
.
resolve
(
'vue-hot-reload-api'
)
const
hotReloadAPIPath
=
JSON
.
stringify
(
require
.
resolve
(
'vue-hot-reload-api'
)
)
exports
.
genHotReloadCode
=
(
id
,
functional
)
=>
{
exports
.
genHotReloadCode
=
(
id
,
functional
)
=>
{
return
wrap
(
`
return
wrap
(
`
...
@@ -13,7 +13,7 @@ exports.genHotReloadCode = (id, functional) => {
...
@@ -13,7 +13,7 @@ exports.genHotReloadCode = (id, functional) => {
exports
.
genTemplateHotReloadCode
=
id
=>
{
exports
.
genTemplateHotReloadCode
=
id
=>
{
return
wrap
(
`
return
wrap
(
`
if (module.hot.data) {
if (module.hot.data) {
require(
'
${
hotReloadAPIPath
}
'
).rerender('
${
id
}
', {
require(
${
hotReloadAPIPath
}
).rerender('
${
id
}
', {
render: render,
render: render,
staticRenderFns: staticRenderFns
staticRenderFns: staticRenderFns
})
})
...
@@ -25,7 +25,7 @@ function wrap (inner) {
...
@@ -25,7 +25,7 @@ function wrap (inner) {
return
`
return
`
/* hot reload */
/* hot reload */
if (module.hot) {
if (module.hot) {
var api = require(
'
${
hotReloadAPIPath
}
'
)
var api = require(
${
hotReloadAPIPath
}
)
api.install(require('vue'))
api.install(require('vue'))
if (api.compatible) {
if (api.compatible) {
module.hot.accept()
module.hot.accept()
...
...
lib/codegen/styleInjection.js
View file @
fb1306e6
const
{
attrsToQuery
}
=
require
(
'./utils'
)
const
{
attrsToQuery
}
=
require
(
'./utils'
)
const
hotReloadAPIPath
=
require
.
resolve
(
'vue-hot-reload-api'
)
const
hotReloadAPIPath
=
JSON
.
stringify
(
require
.
resolve
(
'vue-hot-reload-api'
)
)
module
.
exports
=
function
genStyleInjectionCode
(
module
.
exports
=
function
genStyleInjectionCode
(
loaderContext
,
loaderContext
,
...
@@ -59,7 +59,7 @@ module.exports = function genStyleInjectionCode (
...
@@ -59,7 +59,7 @@ module.exports = function genStyleInjectionCode (
var newLocals = require(
${
request
}
)
var newLocals = require(
${
request
}
)
if (JSON.stringify(newLocals) !== JSON.stringify(oldLocals)) {
if (JSON.stringify(newLocals) !== JSON.stringify(oldLocals)) {
cssModules[
${
name
}
] = newLocals
cssModules[
${
name
}
] = newLocals
require(
"
${
hotReloadAPIPath
}
"
).rerender("
${
id
}
")
require(
${
hotReloadAPIPath
}
).rerender("
${
id
}
")
}
}
}
}
})
})
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment