Skip to content

Commit

Permalink
build: include a esm version
Browse files Browse the repository at this point in the history
  • Loading branch information
merceyz committed Feb 15, 2020
1 parent d14f20c commit 8a590ef
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"name": "babel-plugin-optimize-clsx",
"version": "2.5.0",
"main": "dist/index.js",
"main": "./dist/index.js",
"module": "./dist/index.mjs",
"files": [
"dist"
],
Expand Down
19 changes: 13 additions & 6 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,19 @@ import { existsSync } from 'fs';
import path from 'path';

export default {
input: 'src/index.ts',
output: {
file: 'dist/index.js',
sourcemap: true,
format: 'cjs',
},
input: './src/index.ts',
output: [
{
file: './dist/index.js',
sourcemap: true,
format: 'cjs',
},
{
file: './dist/index.mjs',
sourcemap: true,
format: 'es',
},
],
plugins: [
{
name: 'local-resolve',
Expand Down

0 comments on commit 8a590ef

Please sign in to comment.