Skip to content

Commit ba6b981

Browse files
committed
build: build esm output for tree shaking
1 parent f7cc5af commit ba6b981

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
"dependencies": {
1515
"acorn": "^6.1.1",
1616
"buble": "^0.19.7",
17-
"core-js": "^2.6.5",
1817
"lodash.debounce": "^4.0.8",
1918
"prismjs": "^1.16.0",
2019
"rewrite-imports": "^2.0.3",
@@ -97,7 +96,8 @@
9796
"dist"
9897
],
9998
"license": "MIT",
100-
"main": "./dist/vue-live.common.js",
99+
"main": "dist/vue-live.common.js",
100+
"module": "dist/vue-live.esm.js",
101101
"repository": {
102102
"type": "git",
103103
"url": "git+https://github.com/vue-styleguidist/vue-live.git"

rollup.config.js

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,16 @@ const resolve = _path => path.resolve(__dirname, _path);
1010

1111
export default {
1212
input: resolve("./src/main.js"),
13-
output: {
14-
file: resolve(`./dist/vue-live.common.js`),
15-
format: "cjs"
16-
},
13+
output: [
14+
{
15+
file: resolve(`./dist/vue-live.common.js`),
16+
format: "cjs"
17+
},
18+
{
19+
file: resolve(`./dist/vue-live.esm.js`),
20+
format: "esm"
21+
}
22+
],
1723
plugins: [
1824
cjs(),
1925
node(),

0 commit comments

Comments
 (0)