Skip to content

Commit

Permalink
fix(preset): plugin invoke order don't sort by unicode order (#2656)
Browse files Browse the repository at this point in the history
  • Loading branch information
AmyFoxFN authored and haoqunjiang committed Oct 9, 2018
1 parent 6fd5e5d commit f99796e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/@vue/cli/lib/Creator.js
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ module.exports = class Creator extends EventEmitter {
// { id: options } => [{ id, apply, options }]
async resolvePlugins (rawPlugins) {
// ensure cli-service is invoked first
rawPlugins = sortObject(rawPlugins, ['@vue/cli-service'])
rawPlugins = sortObject(rawPlugins, ['@vue/cli-service'], true)
const plugins = []
for (const id of Object.keys(rawPlugins)) {
const apply = loadModule(`${id}/generator`, this.context) || (() => {})
Expand Down
4 changes: 2 additions & 2 deletions packages/@vue/cli/lib/util/sortObject.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module.exports = function sortObject (obj, keyOrder) {
module.exports = function sortObject (obj, keyOrder, dontSortByUnicode) {
if (!obj) return
const res = {}

Expand All @@ -11,7 +11,7 @@ module.exports = function sortObject (obj, keyOrder) {

const keys = Object.keys(obj)

keys.sort()
!dontSortByUnicode && keys.sort()
keys.forEach(key => {
res[key] = obj[key]
})
Expand Down

0 comments on commit f99796e

Please sign in to comment.