mirror of
https://github.com/vuejs/vue-cli.git
synced 2026-04-29 16:30:33 -05:00
86c500fd4b
* chore: dependency maintenance
* Revert "test: replace `waitForFunction` with `waitForXPath`"
This reverts commit b2848aeeaf.
24 lines
631 B
JavaScript
24 lines
631 B
JavaScript
module.exports = (api, options = {}) => {
|
|
api.injectImports(api.entryFile, `import router from './router'`)
|
|
api.injectRootOptions(api.entryFile, `router`)
|
|
|
|
api.extendPackage({
|
|
dependencies: {
|
|
'vue-router': '^3.1.3'
|
|
}
|
|
})
|
|
|
|
api.render('./template', {
|
|
historyMode: options.historyMode,
|
|
doesCompile: api.hasPlugin('babel') || api.hasPlugin('typescript')
|
|
})
|
|
|
|
if (api.invoking) {
|
|
if (api.hasPlugin('typescript')) {
|
|
/* eslint-disable-next-line node/no-extraneous-require */
|
|
const convertFiles = require('@vue/cli-plugin-typescript/generator/convert')
|
|
convertFiles(api)
|
|
}
|
|
}
|
|
}
|