feat(Poppperjs): add esm output

This commit is contained in:
chenjiahan 2020-12-04 13:31:42 +08:00
parent 1304c6f36b
commit 5f436fc62f
3 changed files with 16 additions and 6 deletions

View File

@ -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/"

View File

@ -4,9 +4,15 @@ import nodeResolve from '@rollup/plugin-node-resolve';
export default {
input: path.join(__dirname, 'src', 'index.ts'),
output: {
dir: 'lib',
output: [
{
dir: 'dist/cjs',
format: 'cjs',
},
{
dir: 'dist/esm',
format: 'esm',
},
],
plugins: [nodeResolve(), babel({ babelHelpers: 'runtime' })],
};

View File

@ -1,7 +1,7 @@
{
"compilerOptions": {
"target": "es5",
"outDir": "./lib",
"outDir": "./dist",
"module": "ES2015",
"strict": true,
"declaration": true,