feat: using mjs entry for sub packages (#10626)

This commit is contained in:
neverland 2022-05-22 20:49:09 +08:00 committed by GitHub
parent 173a364dae
commit 90deb2439f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 5 additions and 4 deletions

View File

@ -3,7 +3,7 @@
"version": "1.2.4",
"description": "Vant 省市区数据",
"main": "dist/index.cjs.js",
"module": "dist/index.esm.js",
"module": "dist/index.esm.mjs",
"types": "dist/index.d.ts",
"files": [
"dist"

View File

@ -3,7 +3,7 @@
"version": "1.1.0",
"description": "Pre-compiled popperjs core",
"main": "dist/index.cjs.js",
"module": "dist/index.esm.js",
"module": "dist/index.esm.mjs",
"types": "dist/index.d.ts",
"sideEffects": false,
"files": [

View File

@ -1,7 +1,8 @@
const { build } = require('esbuild');
function bundleBundle(format) {
const outfile = `dist/index.${format}.js`;
const ext = format === 'esm' ? '.mjs' : '.js';
const outfile = `dist/index.${format}${ext}`;
const finish = () => console.log('Build finished:', outfile);
const onRebuild = (error) => (error ? console.log(error) : finish());

View File

@ -3,7 +3,7 @@
"version": "1.3.6",
"description": "Vant Composition API",
"main": "dist/index.cjs.js",
"module": "dist/index.esm.js",
"module": "dist/index.esm.mjs",
"typings": "dist/index.d.ts",
"sideEffects": false,
"files": [