mirror of https://github.com/vuejs/vitepress
parent
bae47f7082
commit
e5763e1580
@ -1,10 +1,11 @@
|
||||
import path from 'path'
|
||||
import {defineConfig} from 'vite'
|
||||
|
||||
export default {
|
||||
export default defineConfig({
|
||||
resolve: {
|
||||
alias: {
|
||||
node: path.resolve(__dirname, '../src/node'),
|
||||
client: path.resolve(__dirname, '../src/client')
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
|
@ -1,53 +0,0 @@
|
||||
{
|
||||
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
|
||||
|
||||
"projectFolder": "./src/client",
|
||||
|
||||
"mainEntryPointFilePath": "./dist/temp/index.d.ts",
|
||||
|
||||
"dtsRollup": {
|
||||
"enabled": true,
|
||||
"publicTrimmedFilePath": "./dist/client/index.d.ts"
|
||||
},
|
||||
|
||||
"apiReport": {
|
||||
"enabled": false
|
||||
},
|
||||
|
||||
"docModel": {
|
||||
"enabled": false
|
||||
},
|
||||
|
||||
"tsdocMetadata": {
|
||||
"enabled": false
|
||||
},
|
||||
|
||||
"messages": {
|
||||
"compilerMessageReporting": {
|
||||
"default": {
|
||||
"logLevel": "warning"
|
||||
}
|
||||
},
|
||||
|
||||
"extractorMessageReporting": {
|
||||
"default": {
|
||||
"logLevel": "warning",
|
||||
"addToApiReportFile": true
|
||||
},
|
||||
|
||||
"ae-missing-release-tag": {
|
||||
"logLevel": "none"
|
||||
}
|
||||
},
|
||||
|
||||
"tsdocMessageReporting": {
|
||||
"default": {
|
||||
"logLevel": "warning"
|
||||
},
|
||||
|
||||
"tsdoc-undefined-tag": {
|
||||
"logLevel": "none"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,53 +0,0 @@
|
||||
{
|
||||
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
|
||||
|
||||
"projectFolder": "./src/node",
|
||||
|
||||
"mainEntryPointFilePath": "./dist/temp/index.d.ts",
|
||||
|
||||
"dtsRollup": {
|
||||
"enabled": true,
|
||||
"publicTrimmedFilePath": "./dist/node/index.d.ts"
|
||||
},
|
||||
|
||||
"apiReport": {
|
||||
"enabled": false
|
||||
},
|
||||
|
||||
"docModel": {
|
||||
"enabled": false
|
||||
},
|
||||
|
||||
"tsdocMetadata": {
|
||||
"enabled": false
|
||||
},
|
||||
|
||||
"messages": {
|
||||
"compilerMessageReporting": {
|
||||
"default": {
|
||||
"logLevel": "warning"
|
||||
}
|
||||
},
|
||||
|
||||
"extractorMessageReporting": {
|
||||
"default": {
|
||||
"logLevel": "warning",
|
||||
"addToApiReportFile": true
|
||||
},
|
||||
|
||||
"ae-missing-release-tag": {
|
||||
"logLevel": "none"
|
||||
}
|
||||
},
|
||||
|
||||
"tsdocMessageReporting": {
|
||||
"default": {
|
||||
"logLevel": "warning"
|
||||
},
|
||||
|
||||
"tsdoc-undefined-tag": {
|
||||
"logLevel": "none"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,2 +1,2 @@
|
||||
#!/usr/bin/env node
|
||||
require('../dist/node/cli')
|
||||
import('../dist/node/cli.js')
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,70 @@
|
||||
import { defineConfig } from 'rollup'
|
||||
import { nodeResolve } from '@rollup/plugin-node-resolve'
|
||||
import commonjs from '@rollup/plugin-commonjs'
|
||||
import esbuild from 'rollup-plugin-esbuild'
|
||||
import json from '@rollup/plugin-json'
|
||||
import dts from 'rollup-plugin-dts'
|
||||
import alias from '@rollup/plugin-alias'
|
||||
import { resolve } from 'path'
|
||||
import { fileURLToPath } from 'url'
|
||||
import pkg from './package.json'
|
||||
|
||||
const ROOT = fileURLToPath(import.meta.url)
|
||||
const r = (p:string) => resolve(ROOT, '..', p)
|
||||
|
||||
const external =[
|
||||
...Object.keys(pkg.dependencies),
|
||||
'buffer',
|
||||
'punycode',
|
||||
'prismjs/components/index.js'
|
||||
]
|
||||
|
||||
export default defineConfig([
|
||||
{
|
||||
input: [r('src/node/index.ts'), r('src/node/cli.ts')],
|
||||
output: {
|
||||
format: 'esm',
|
||||
dir: r('dist/node')
|
||||
},
|
||||
external,
|
||||
plugins: [
|
||||
alias({
|
||||
entries: {
|
||||
'readable-stream': 'stream'
|
||||
}
|
||||
}),
|
||||
commonjs(),
|
||||
nodeResolve(),
|
||||
esbuild({
|
||||
target: 'node14'
|
||||
}),
|
||||
json()
|
||||
],
|
||||
onwarn(warning, warn) {
|
||||
if (warning.code !== 'EVAL') warn(warning)
|
||||
}
|
||||
}, {
|
||||
input: r('src/node/index.ts'),
|
||||
output: {
|
||||
format: 'esm',
|
||||
file: 'dist/node/index.d.ts'
|
||||
},
|
||||
plugins: [
|
||||
dts()
|
||||
]
|
||||
},
|
||||
{
|
||||
input: r('src/client/index.ts'),
|
||||
output: {
|
||||
format: 'esm',
|
||||
file: 'dist/client/index.d.ts'
|
||||
},
|
||||
plugins: [
|
||||
dts({
|
||||
compilerOptions: {
|
||||
"skipLibCheck": true,
|
||||
}
|
||||
})
|
||||
]
|
||||
}
|
||||
])
|
@ -1,11 +1,12 @@
|
||||
const fs = require('fs-extra')
|
||||
const glob = require('globby')
|
||||
import { copy } from 'fs-extra'
|
||||
import { sync } from 'globby'
|
||||
|
||||
function toDest(file) {
|
||||
return file.replace(/^src\//, 'dist/')
|
||||
}
|
||||
|
||||
glob.sync('src/client/**').forEach((file) => {
|
||||
if (/(\.ts|tsconfig\.json)$/.test(file)) return
|
||||
fs.copy(file, toDest(file))
|
||||
sync('src/client/**').forEach((file) => {
|
||||
if (/(\.ts|tsconfig\.json)$/.test(file))
|
||||
return
|
||||
copy(file, toDest(file))
|
||||
})
|
||||
|
@ -1,7 +1,8 @@
|
||||
const fs = require('fs-extra')
|
||||
const glob = require('globby')
|
||||
import { copy } from 'fs-extra'
|
||||
import { sync } from 'globby'
|
||||
|
||||
glob.sync('src/shared/**/*.ts').forEach((file) => {
|
||||
fs.copy(file, file.replace(/^src\/shared\//, 'src/node/'))
|
||||
fs.copy(file, file.replace(/^src\/shared\//, 'src/client/'))
|
||||
sync('src/shared/**/*.ts')
|
||||
.map(async (file) => {
|
||||
await copy(file, file.replace(/^src\/shared\//, 'src/node/'))
|
||||
await copy(file, file.replace(/^src\/shared\//, 'src/client/'))
|
||||
})
|
||||
|
@ -1,35 +0,0 @@
|
||||
import { defineConfig } from 'rollup'
|
||||
import { nodeResolve } from '@rollup/plugin-node-resolve'
|
||||
import commonjs from '@rollup/plugin-commonjs'
|
||||
import esbuild from 'rollup-plugin-esbuild'
|
||||
import json from '@rollup/plugin-json'
|
||||
import alias from '@rollup/plugin-alias'
|
||||
import { resolve } from 'path'
|
||||
|
||||
const r = (p) => resolve(__dirname, '../', p)
|
||||
const pkg = require('../package.json')
|
||||
|
||||
export default defineConfig({
|
||||
input: [r('src/node/index.ts'), r('src/node/cli.ts')],
|
||||
output: {
|
||||
format: 'cjs',
|
||||
dir: r('dist/node')
|
||||
},
|
||||
external: [...Object.keys(pkg.dependencies), 'buffer', 'punycode'],
|
||||
plugins: [
|
||||
alias({
|
||||
entries: {
|
||||
'readable-stream': 'stream'
|
||||
}
|
||||
}),
|
||||
commonjs(),
|
||||
nodeResolve(),
|
||||
esbuild({
|
||||
target: 'node12'
|
||||
}),
|
||||
json()
|
||||
],
|
||||
onwarn(warning, warn) {
|
||||
if (warning.code !== 'EVAL') warn(warning)
|
||||
}
|
||||
})
|
@ -1,12 +1,17 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "esnext",
|
||||
"target": "esnext",
|
||||
"moduleResolution": "node",
|
||||
"strict": true,
|
||||
"noUnusedLocals": true,
|
||||
"skipLibCheck": true,
|
||||
"esModuleInterop": true,
|
||||
"lib": ["ESNext"]
|
||||
"resolveJsonModule": true,
|
||||
"lib": ["ESNext", "DOM"],
|
||||
},
|
||||
"include": ["../types/shared.d.ts"]
|
||||
"exclude": [
|
||||
"node_modules",
|
||||
"dist"
|
||||
]
|
||||
}
|
Loading…
Reference in new issue