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
4a894de8
Commit
4a894de8
authored
Sep 11, 2018
by
Evan You
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: include query in loader dedupe
ref: vue-cli#2451
parent
20f359de
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
3 deletions
+8
-3
pitcher.js
lib/loaders/pitcher.js
+8
-3
No files found.
lib/loaders/pitcher.js
View file @
4a894de8
...
@@ -63,14 +63,19 @@ module.exports.pitch = function (remainingRequest) {
...
@@ -63,14 +63,19 @@ module.exports.pitch = function (remainingRequest) {
// also make sure to dedupe based on loader path.
// also make sure to dedupe based on loader path.
// assumes you'd probably never want to apply the same loader on the same
// assumes you'd probably never want to apply the same loader on the same
// file twice.
// file twice.
// Exception: in Vue CLI we do need two instances of postcss-loader
// for user config and inline minification. So we need to dedupe baesd on
// path AND query to be safe.
const
seen
=
new
Map
()
const
seen
=
new
Map
()
const
loaderStrings
=
[]
const
loaderStrings
=
[]
loaders
.
forEach
(
loader
=>
{
loaders
.
forEach
(
loader
=>
{
const
type
=
typeof
loader
===
'string'
?
loader
:
loader
.
path
const
identifier
=
typeof
loader
===
'string'
?
loader
:
(
loader
.
path
+
loader
.
query
)
const
request
=
typeof
loader
===
'string'
?
loader
:
loader
.
request
const
request
=
typeof
loader
===
'string'
?
loader
:
loader
.
request
if
(
!
seen
.
has
(
type
))
{
if
(
!
seen
.
has
(
identifier
))
{
seen
.
set
(
type
,
true
)
seen
.
set
(
identifier
,
true
)
// loader.request contains both the resolved loader path and its options
// loader.request contains both the resolved loader path and its options
// query (e.g. ??ref-0)
// query (e.g. ??ref-0)
loaderStrings
.
push
(
request
)
loaderStrings
.
push
(
request
)
...
...
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