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
a2b89d3c
Commit
a2b89d3c
authored
Dec 17, 2020
by
Haoqun Jiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: resourceQuery could be undefined in webpack 5
fixes #1771
parent
0edc4b6b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
1 deletion
+18
-1
index.js
lib/index.js
+1
-1
plugin-webpack5.js
lib/plugin-webpack5.js
+2
-0
edgeCases.spec.js
test/edgeCases.spec.js
+15
-0
No files found.
lib/index.js
View file @
a2b89d3c
...
@@ -49,7 +49,7 @@ module.exports = function (source) {
...
@@ -49,7 +49,7 @@ module.exports = function (source) {
sourceMap
,
sourceMap
,
rootContext
,
rootContext
,
resourcePath
,
resourcePath
,
resourceQuery
resourceQuery
=
''
}
=
loaderContext
}
=
loaderContext
const
rawQuery
=
resourceQuery
.
slice
(
1
)
const
rawQuery
=
resourceQuery
.
slice
(
1
)
...
...
lib/plugin-webpack5.js
View file @
a2b89d3c
...
@@ -120,6 +120,7 @@ class VueLoaderPlugin {
...
@@ -120,6 +120,7 @@ class VueLoaderPlugin {
const
pitcher
=
{
const
pitcher
=
{
loader
:
require
.
resolve
(
'./loaders/pitcher'
),
loader
:
require
.
resolve
(
'./loaders/pitcher'
),
resourceQuery
:
query
=>
{
resourceQuery
:
query
=>
{
if
(
!
query
)
{
return
false
}
const
parsed
=
qs
.
parse
(
query
.
slice
(
1
))
const
parsed
=
qs
.
parse
(
query
.
slice
(
1
))
return
parsed
.
vue
!=
null
return
parsed
.
vue
!=
null
},
},
...
@@ -172,6 +173,7 @@ function cloneRule (rawRule, refs) {
...
@@ -172,6 +173,7 @@ function cloneRule (rawRule, refs) {
return
true
return
true
},
},
resourceQuery
:
query
=>
{
resourceQuery
:
query
=>
{
if
(
!
query
)
{
return
false
}
const
parsed
=
qs
.
parse
(
query
.
slice
(
1
))
const
parsed
=
qs
.
parse
(
query
.
slice
(
1
))
if
(
parsed
.
vue
==
null
)
{
if
(
parsed
.
vue
==
null
)
{
return
false
return
false
...
...
test/edgeCases.spec.js
View file @
a2b89d3c
const
path
=
require
(
'path'
)
const
path
=
require
(
'path'
)
const
normalizeNewline
=
require
(
'normalize-newline'
)
const
normalizeNewline
=
require
(
'normalize-newline'
)
const
webpack
=
require
(
'webpack'
)
const
HTMLPlugin
=
require
(
'html-webpack-plugin'
)
const
HTMLPlugin
=
require
(
'html-webpack-plugin'
)
const
{
const
{
...
@@ -212,3 +213,17 @@ test('use with postLoader', done => {
...
@@ -212,3 +213,17 @@ test('use with postLoader', done => {
},
done
)
},
done
)
})
})
})
})
// #1711
test
(
'data: URI as entry'
,
done
=>
{
// this feature is only available in webpack 5
if
(
webpack
.
version
.
startsWith
(
'4'
))
{
return
}
bundle
({
entry
:
{
main
:
'data:text/javascript,console.log("hello world")'
}
},
()
=>
done
())
})
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