Skip to content

Commit

Permalink
build: allow browser es modules
Browse files Browse the repository at this point in the history
  • Loading branch information
shadowtime2000 committed Dec 15, 2020
1 parent 90e1395 commit 85433b8
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"homepage": "https://eta.js.org",
"main": "dist/eta.cjs",
"browser": "dist/browser/eta.min.js",
"module": "dist/eta.es.js",
"module": "dist/browser/eta.es.min.js",
"type": "module",
"exports": {
"import": "./dist/eta.es.js",
Expand Down
13 changes: 12 additions & 1 deletion rollup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,17 @@ export default [
name: 'Eta',
sourcemap: true,
plugins: [terser()]
},
{
file: 'dist/browser/eta.es.js',
format: 'es',
sourcemap: true
},
{
file: pkg.module,
format: 'es',
sourcemap: true,
plugins: [terser()]
}
],
plugins: [typescript({ useTsconfigDeclarationDir: true }), commonjs(), resolve()],
Expand All @@ -42,7 +53,7 @@ export default [
sourcemap: true
},
{
file: pkg.module,
file: pkg.exports.import,
format: 'es',
sourcemap: true
}
Expand Down

0 comments on commit 85433b8

Please sign in to comment.