Skip to content

Commit 428d671

Browse files
committed
use/inject plugins file too
1 parent df71a85 commit 428d671

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

generator/index.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ module.exports = (api) => {
1717
// add import
1818
api.injectImports(api.entryFile,
1919
`import Extensionpoints from 'vue-extensionpoints'`)
20+
api.injectImports(api.entryFile,
21+
`import plugins from '@/plugins'`)
2022
}
2123

2224
module.exports.hooks = (api) => {
@@ -27,9 +29,9 @@ module.exports.hooks = (api) => {
2729
const lines = contentMain.split(/\r?\n/g)
2830

2931
// if not already found, add Vue.use to file
30-
if(lines.findIndex(line => line.match(/Vue.use\(Extensionpoints\)/)) < 0) {
32+
if(lines.findIndex(line => line.match(/Vue.use\(Extensionpoints/)) < 0) {
3133
const renderIndex = lines.findIndex(line => line.match(/new Vue/))
32-
lines[renderIndex] = `Vue.use(Extensionpoints)${EOL}${EOL}` + lines[renderIndex]
34+
lines[renderIndex] = `Vue.use(Extensionpoints, plugins)${EOL}${EOL}` + lines[renderIndex]
3335
fs.writeFileSync(api.entryFile, lines.join(EOL), { encoding: 'utf-8' })
3436
}
3537
})

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vue-cli-plugin-extensionpoints",
3-
"version": "0.1.3",
3+
"version": "0.1.4",
44
"description": "Vue CLI plugin for adding extensionpoints",
55
"main": "index.js",
66
"author": "Christian González <[email protected]",

0 commit comments

Comments
 (0)