forked from mmoollllee/nuxt-protected-mailto
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmodule.js
28 lines (27 loc) · 798 Bytes
/
module.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// module.js
const { resolve, join } = require('path')
const { readdirSync } = require('fs')
export default function () {
// add all of the initial plugins
const pluginsToSync = [
'components/index.js'
]
for (const pathString of pluginsToSync) {
this.addPlugin({
src: resolve(__dirname, pathString),
fileName: pathString
})
}
// sync all of the files and folders to revelant places in the nuxt build dir (.nuxt/)
const foldersToSync = ['components/lib']
for (const pathString of foldersToSync) {
const path = resolve(__dirname, pathString)
for (const file of readdirSync(path)) {
this.addTemplate({
src: resolve(path, file),
fileName: join(pathString, file)
})
}
}
}
module.exports.meta = require('./package.json')