mirror of
https://github.com/vuejs/vue-cli.git
synced 2026-01-21 06:39:56 -06:00
13 lines
266 B
JavaScript
13 lines
266 B
JavaScript
const fs = require('fs')
|
|
const path = require('path')
|
|
|
|
exports.toPlugin = id => ({ id, apply: require(id) })
|
|
|
|
exports.findExisting = (context, files) => {
|
|
for (const file of files) {
|
|
if (fs.existsSync(path.join(context, file))) {
|
|
return file
|
|
}
|
|
}
|
|
}
|