build: using rollup-plugin-esbuild

This commit is contained in:
chenjiahan
2021-11-11 11:08:02 +08:00
parent 2bfbe5f86e
commit 74bc0879c4
12 changed files with 80 additions and 112 deletions

View File

@@ -1,3 +0,0 @@
module.exports = {
presets: [['@vant/cli/preset.cjs', { loose: true }]],
};

View File

@@ -14,8 +14,11 @@
"registry": "https://registry.npmjs.org/"
},
"scripts": {
"clean": "rm -rf ./dist",
"dev": "rollup --config rollup.config.js --watch",
"build": "rollup --config rollup.config.js && tsc -p ./tsconfig.json --emitDeclarationOnly",
"build:types": "tsc -p ./tsconfig.json --emitDeclarationOnly",
"build:bundle": "rollup --config rollup.config.js",
"build": "pnpm clean && pnpm build:bundle && pnpm build:types",
"release": "pnpm build && release-it",
"prepare": "pnpm build"
},
@@ -25,11 +28,11 @@
"@popperjs/core": "^2.9.2"
},
"devDependencies": {
"@vant/cli": "workspace:*",
"@rollup/plugin-babel": "^5.2.1",
"@rollup/plugin-node-resolve": "^10.0.0",
"release-it": "^14.2.2",
"rollup": "^2.33.3"
"typescript": "4.x",
"rollup": "^2.33.3",
"rollup-plugin-esbuild": "^4.6.0",
"@rollup/plugin-node-resolve": "^13.0.0",
"release-it": "^14.2.2"
},
"release-it": {
"git": {

View File

@@ -1,5 +1,5 @@
import path from 'path';
import babel from '@rollup/plugin-babel';
import esbuild from 'rollup-plugin-esbuild';
import nodeResolve from '@rollup/plugin-node-resolve';
export default {
@@ -14,8 +14,5 @@ export default {
format: 'esm',
},
],
plugins: [
babel({ babelHelpers: 'bundled', extensions: ['.js', '.ts'] }),
nodeResolve(),
],
plugins: [esbuild(), nodeResolve()],
};

View File

@@ -2,13 +2,11 @@
"compilerOptions": {
"target": "ES2015",
"outDir": "./dist",
"module": "ES2015",
"module": "ESNext",
"strict": true,
"declaration": true,
"skipLibCheck": true,
"esModuleInterop": true,
"moduleResolution": "node",
"lib": ["esnext", "dom"]
"moduleResolution": "Node",
},
"include": ["src/**/*"]
}