mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
chore(popperjs): use Rslib to build (#13252)
This commit is contained in:
parent
e825175615
commit
8018fc19e6
@ -1 +0,0 @@
|
|||||||
lib
|
|
@ -1 +0,0 @@
|
|||||||
require('../vant-use/build.cjs');
|
|
@ -2,13 +2,15 @@
|
|||||||
"name": "@vant/popperjs",
|
"name": "@vant/popperjs",
|
||||||
"version": "1.3.0",
|
"version": "1.3.0",
|
||||||
"description": "Pre-compiled popperjs core",
|
"description": "Pre-compiled popperjs core",
|
||||||
"main": "dist/index.cjs.js",
|
"type": "module",
|
||||||
"module": "dist/index.esm.mjs",
|
"main": "dist/index.cjs",
|
||||||
|
"module": "dist/index.js",
|
||||||
"types": "dist/index.d.ts",
|
"types": "dist/index.d.ts",
|
||||||
"exports": {
|
"exports": {
|
||||||
".": {
|
".": {
|
||||||
"import": "./dist/index.esm.mjs",
|
"types": "./dist/index.d.ts",
|
||||||
"require": "./dist/index.cjs.js"
|
"import": "./dist/index.js",
|
||||||
|
"require": "./dist/index.cjs"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"sideEffects": false,
|
"sideEffects": false,
|
||||||
@ -20,11 +22,8 @@
|
|||||||
"registry": "https://registry.npmjs.org/"
|
"registry": "https://registry.npmjs.org/"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"clean": "rimraf ./dist",
|
"dev": "rslib dev",
|
||||||
"dev": "node ./build.js -w",
|
"build": "rslib build",
|
||||||
"build:types": "tsc -p ./tsconfig.json --emitDeclarationOnly",
|
|
||||||
"build:bundle": "node ./build.js",
|
|
||||||
"build": "pnpm clean && pnpm build:bundle && pnpm build:types",
|
|
||||||
"release": "vant-cli release",
|
"release": "vant-cli release",
|
||||||
"prepare": "pnpm build"
|
"prepare": "pnpm build"
|
||||||
},
|
},
|
||||||
@ -38,8 +37,7 @@
|
|||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@popperjs/core": "^2.11.8",
|
"@popperjs/core": "^2.11.8",
|
||||||
"esbuild": "^0.24.0",
|
"@rslib/core": "^0.1.3",
|
||||||
"rimraf": "^6.0.1",
|
|
||||||
"typescript": "^5.7.2"
|
"typescript": "^5.7.2"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
11
packages/vant-popperjs/rslib.config.ts
Normal file
11
packages/vant-popperjs/rslib.config.ts
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
import { defineConfig } from '@rslib/core';
|
||||||
|
|
||||||
|
export default defineConfig({
|
||||||
|
lib: [
|
||||||
|
{ format: 'esm', syntax: ['Chrome 53'], dts: true },
|
||||||
|
{ format: 'cjs', syntax: ['Chrome 53'] },
|
||||||
|
],
|
||||||
|
output: {
|
||||||
|
target: 'web',
|
||||||
|
},
|
||||||
|
});
|
@ -1,40 +0,0 @@
|
|||||||
const { build, context } = require('esbuild');
|
|
||||||
|
|
||||||
async function bundle(format) {
|
|
||||||
const ext = format === 'esm' ? '.mjs' : '.js';
|
|
||||||
const outfile = `dist/index.${format}${ext}`;
|
|
||||||
const finish = () => console.log('Build finished:', outfile);
|
|
||||||
|
|
||||||
const options = {
|
|
||||||
format,
|
|
||||||
bundle: true,
|
|
||||||
target: ['chrome53'],
|
|
||||||
outfile,
|
|
||||||
// preserve Chinese character
|
|
||||||
charset: 'utf8',
|
|
||||||
external: ['vue', 'vant'],
|
|
||||||
entryPoints: ['./src/index.ts'],
|
|
||||||
};
|
|
||||||
|
|
||||||
if (process.argv.includes('-w')) {
|
|
||||||
const loggerPlugin = {
|
|
||||||
name: 'loggerPlugin',
|
|
||||||
setup(build) {
|
|
||||||
build.onEnd(finish);
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
const ctx = await context({
|
|
||||||
...options,
|
|
||||||
plugins: [loggerPlugin],
|
|
||||||
});
|
|
||||||
|
|
||||||
await ctx.watch();
|
|
||||||
} else {
|
|
||||||
await build(options);
|
|
||||||
finish();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bundle('esm');
|
|
||||||
bundle('cjs');
|
|
@ -37,7 +37,6 @@
|
|||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@rslib/core": "^0.1.3",
|
"@rslib/core": "^0.1.3",
|
||||||
"esbuild": "^0.24.0",
|
|
||||||
"typescript": "^5.7.2",
|
"typescript": "^5.7.2",
|
||||||
"vue": "^3.5.13"
|
"vue": "^3.5.13"
|
||||||
},
|
},
|
||||||
|
12
pnpm-lock.yaml
generated
12
pnpm-lock.yaml
generated
@ -329,12 +329,9 @@ importers:
|
|||||||
'@popperjs/core':
|
'@popperjs/core':
|
||||||
specifier: ^2.11.8
|
specifier: ^2.11.8
|
||||||
version: 2.11.8
|
version: 2.11.8
|
||||||
esbuild:
|
'@rslib/core':
|
||||||
specifier: ^0.24.0
|
specifier: ^0.1.3
|
||||||
version: 0.24.0
|
version: 0.1.3(typescript@5.7.2)
|
||||||
rimraf:
|
|
||||||
specifier: ^6.0.1
|
|
||||||
version: 6.0.1
|
|
||||||
typescript:
|
typescript:
|
||||||
specifier: ^5.7.2
|
specifier: ^5.7.2
|
||||||
version: 5.7.2
|
version: 5.7.2
|
||||||
@ -346,9 +343,6 @@ importers:
|
|||||||
'@rslib/core':
|
'@rslib/core':
|
||||||
specifier: ^0.1.3
|
specifier: ^0.1.3
|
||||||
version: 0.1.3(typescript@5.7.2)
|
version: 0.1.3(typescript@5.7.2)
|
||||||
esbuild:
|
|
||||||
specifier: ^0.24.0
|
|
||||||
version: 0.24.0
|
|
||||||
typescript:
|
typescript:
|
||||||
specifier: ^5.7.2
|
specifier: ^5.7.2
|
||||||
version: 5.7.2
|
version: 5.7.2
|
||||||
|
Loading…
x
Reference in New Issue
Block a user