Commit 12a39ce0 by xuzhenzhao

chore(custom): ts target set 'es5'

.gitignore add macos temp
package.json add typedoc script
parent ca609c57
...@@ -9,8 +9,7 @@ ...@@ -9,8 +9,7 @@
"next": "bash scripts/publish-next.sh", "next": "bash scripts/publish-next.sh",
"commit": "git add . && npx cz-customizable", "commit": "git add . && npx cz-customizable",
"preinstall": "npx only-allow pnpm", "preinstall": "npx only-allow pnpm",
"lib": "pnpm --filter=@ydl-packages/* run lib", "lib": "pnpm --filter=@ydl-packages/* run lib"
"prepublishOnly": "npm run lib"
}, },
"keywords": [], "keywords": [],
"author": "xuzhenzhao", "author": "xuzhenzhao",
......
...@@ -6,7 +6,8 @@ ...@@ -6,7 +6,8 @@
"scripts": { "scripts": {
"lib": "npx vite build", "lib": "npx vite build",
"test": "npx jest __tests__", "test": "npx jest __tests__",
"doc": "npx typedoc" "doc": "npx typedoc",
"prepublishOnly": "npm run lib"
}, },
"keywords": [ "keywords": [
"pay", "pay",
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
// "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */ // "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */
/* Language and Environment */ /* Language and Environment */
"target": "es2015", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */ "target": "es5", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */
// "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */ // "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */
// "jsx": "preserve", /* Specify what JSX code is generated. */ // "jsx": "preserve", /* Specify what JSX code is generated. */
// "experimentalDecorators": true, /* Enable experimental support for TC39 stage 2 draft decorators. */ // "experimentalDecorators": true, /* Enable experimental support for TC39 stage 2 draft decorators. */
......
import path from 'path' import path from 'path'
import {defineConfig} from 'vite' import { defineConfig } from 'vite'
import dts from 'vite-plugin-dts' import dts from 'vite-plugin-dts'
export default defineConfig(() => { export default defineConfig(() => {
return { return {
resolve: { resolve: {
alias: { alias: {
'@': path.resolve(__dirname, './src') '@': path.resolve(__dirname, './src')
} }
}, },
build: { build: {
target: "es2015", target: 'es2015',
lib: { lib: {
entry: path.resolve(__dirname, 'src/index'), entry: path.resolve(__dirname, 'src/index'),
name: 'toolkit', name: 'toolkit',
fileName: 'index', fileName: 'index',
formats: ['es', 'umd'], formats: ['es', 'umd'],
sourcemap: 'inline' sourcemap: 'inline'
}, },
outDir: path.resolve(__dirname, 'dist') outDir: path.resolve(__dirname, 'dist')
}, },
plugins: [dts()] plugins: [dts()]
} }
}) })
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment