Skip to content

Commit ab46eac

Browse files
committed
build: update vompiler and rollup config
1 parent 020da13 commit ab46eac

File tree

3 files changed

+21
-32
lines changed

3 files changed

+21
-32
lines changed

package-lock.json

Lines changed: 9 additions & 18 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"core-js": "^2.6.5",
1717
"debounce": "^1.2.0",
1818
"prismjs": "^1.16.0",
19-
"vue-inbrowser-compiler": "^3.16.3",
19+
"vue-inbrowser-compiler": "^3.21.0",
2020
"vue-prism-editor": "^0.2.1"
2121
},
2222
"devDependencies": {
@@ -60,6 +60,7 @@
6060
],
6161
"license": "MIT",
6262
"main": "dist/vue-live.common.js",
63+
"module": "dist/vue-live.esm.js",
6364
"repository": {
6465
"type": "git",
6566
"url": "git+https://github.com/vue-styleguidist/vue-live.git"

rollup.config.js

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,27 @@
11
import * as path from "path";
2-
import cjs from "rollup-plugin-commonjs";
2+
import commonjs from "rollup-plugin-commonjs";
33
import babel from "rollup-plugin-babel";
44
import vue from "rollup-plugin-vue";
55
import css from "rollup-plugin-css-only";
6+
import pkg from "./package.json";
67

78
const resolve = _path => path.resolve(__dirname, _path);
89

910
export default {
1011
input: resolve("./src/main.js"),
1112
output: [
1213
{
13-
file: resolve(`./dist/vue-live.common.js`),
14-
format: "cjs",
15-
exports: "named"
14+
file: pkg.main,
15+
name: "VueLive",
16+
format: "umd"
1617
},
1718
{
18-
file: resolve(`./dist/vue-live.esm.js`),
19-
format: "esm"
19+
file: pkg.module,
20+
format: "es" // the preferred format
2021
}
2122
],
2223
plugins: [
23-
cjs(),
24+
commonjs(),
2425
babel({
2526
babelrc: false,
2627
presets: [["@vue/babel-preset-app", { useBuiltIns: false }]],
@@ -31,11 +32,7 @@ export default {
3132
css()
3233
],
3334
external: [
34-
"debounce",
35-
"vue-inbrowser-compiler",
36-
"prismjs",
37-
"prismjs/components/prism-jsx.min",
38-
"vue-prism-editor",
39-
"hash-sum"
35+
...Object.keys(pkg.dependencies),
36+
"prismjs/components/prism-jsx.min"
4037
]
4138
};

0 commit comments

Comments
 (0)