Skip to content

Commit

Permalink
更新代码
Browse files Browse the repository at this point in the history
  • Loading branch information
biaov committed May 28, 2024
1 parent 7fe3c08 commit b53efb9
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion scripts/external.ts
Original file line number Diff line number Diff line change
@@ -3,4 +3,4 @@ import pkg from '../package.json'
/**
* 扩展
*/
export const external = Object.keys(pkg.dependencies)
export default Object.keys(pkg.dependencies)
2 changes: 0 additions & 2 deletions scripts/index.ts

This file was deleted.

3 changes: 2 additions & 1 deletion scripts/rollup-plugin-copy.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import type { InputPluginOption } from 'rollup'
import { writeFileSync, copyFileSync, existsSync, readdirSync, mkdirSync, statSync, unlinkSync } from 'fs'
import { join } from 'path'
import pkg from '../package.json' assert { type: 'json' }
@@ -60,7 +61,7 @@ export const copyAssets = () => {
})
}

export default () => ({
export default (): InputPluginOption => ({
name: 'rollup-plugin-copy',
closeBundle() {
rewritePackage()
7 changes: 4 additions & 3 deletions vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { resolve } from 'path'
import { external, rollupPluginCopy } from './scripts'
import external from './scripts/external'
import rollupPluginCopy from './scripts/rollup-plugin-copy'

const { dirname } = import.meta

@@ -14,9 +15,9 @@ export default {
},
build: {
target: 'node20',
outDir: resolve(dirname, './dist/dist'),
outDir: './dist/dist',
lib: {
entry: resolve(dirname, './src/index.ts'),
entry: './src/index.ts',
formats: ['es']
},
rollupOptions: {

0 comments on commit b53efb9

Please sign in to comment.