build: 优化 scripts/create 生成插件包流程

This commit is contained in:
pengzhanbo 2022-08-12 15:28:18 +08:00
parent 32e759400d
commit d0c0950b89
5 changed files with 12 additions and 5 deletions

View File

@ -29,7 +29,7 @@ const generatorFile = async (config: ConfigOptions): Promise<void> => {
shared,
version: pkg.version,
}
const include = [!client && 'client', !shared && 'shared'].filter(Boolean).join('|')
const include = [!client && 'client', !client && 'tsconfig.esm.json', !shared && 'shared'].filter(Boolean).join('|')
const filterRE = new RegExp(`/(${include})/`)
const templates = templateList.filter(({ file }) => {
return !filterRE.test(file)

View File

@ -7,6 +7,7 @@ yarn add @vuepress-plume/vuepress-{{ pkgName }}
## Usage
``` js
// .vuepress/config.js
const {{ lowerName }}Plugin = require('@vuepress-plume/vuepress-{{ pkgName }}')
module.exports = {
//...
plugins: [

View File

@ -1,9 +1,11 @@
{
"extends": "../../tsconfig.base.json",
"references": [
{{#if client}}
{
"path": "./tsconfig.esm.json"
},
{{/if}}
{
"path": "./tsconfig.cjs.json"
}

View File

@ -6,7 +6,9 @@
"outDir": "./lib"
},
"include": [
"./src/node",
"./src/shared"
{{#if shared}}
"./src/shared",
{{/if}}
"./src/node"
]
}

View File

@ -9,7 +9,9 @@
]
},
"include": [
"./src/client",
"./src/shared"
{{#if shared}}
"./src/shared",
{{/if}}
"./src/client"
]
}