diff --git a/packages/vant-popperjs/package.json b/packages/vant-popperjs/package.json index 5731c7d3c..77c3bd352 100644 --- a/packages/vant-popperjs/package.json +++ b/packages/vant-popperjs/package.json @@ -2,8 +2,12 @@ "name": "@vant/popperjs", "version": "1.0.0", "description": "Precompiled popperjs core", - "main": "lib/index.js", + "main": "dist/cjs/index.js", + "module": "dist/esm/index.js", "types": "lib/index.d.ts", + "files": [ + "dist" + ], "publishConfig": { "access": "public", "registry": "https://registry.npmjs.org/" diff --git a/packages/vant-popperjs/rollup.config.js b/packages/vant-popperjs/rollup.config.js index a2bf18ab5..162b32861 100644 --- a/packages/vant-popperjs/rollup.config.js +++ b/packages/vant-popperjs/rollup.config.js @@ -4,9 +4,15 @@ import nodeResolve from '@rollup/plugin-node-resolve'; export default { input: path.join(__dirname, 'src', 'index.ts'), - output: { - dir: 'lib', - format: 'cjs', - }, + output: [ + { + dir: 'dist/cjs', + format: 'cjs', + }, + { + dir: 'dist/esm', + format: 'esm', + }, + ], plugins: [nodeResolve(), babel({ babelHelpers: 'runtime' })], }; diff --git a/packages/vant-popperjs/tsconfig.json b/packages/vant-popperjs/tsconfig.json index 4f8094c6f..988d8e278 100644 --- a/packages/vant-popperjs/tsconfig.json +++ b/packages/vant-popperjs/tsconfig.json @@ -1,7 +1,7 @@ { "compilerOptions": { "target": "es5", - "outDir": "./lib", + "outDir": "./dist", "module": "ES2015", "strict": true, "declaration": true,