Skip to content

Commit 29ebc2b

Browse files
committed
use external-helpers just for rollup
1 parent 304ea66 commit 29ebc2b

File tree

6 files changed

+24
-9
lines changed

6 files changed

+24
-9
lines changed

.babelrc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
],
1010
"plugins": [
1111
"transform-object-rest-spread",
12-
"transform-object-assign",
13-
"external-helpers"
12+
"transform-object-assign"
1413
]
1514
}

build/configs.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ const configs = {
3131
}
3232
}
3333

34-
function genConfig (opts) {
34+
function genConfig(opts) {
3535
const config = {
3636
input: {
3737
input: opts.input,
@@ -40,7 +40,8 @@ function genConfig (opts) {
4040
__VERSION__: version
4141
}),
4242
babel({
43-
exclude: 'node_modules/**'
43+
exclude: 'node_modules/**',
44+
plugins: ['external-helpers']
4445
})
4546
]
4647
},
@@ -61,7 +62,7 @@ function genConfig (opts) {
6162
return config
6263
}
6364

64-
function mapValues (obj, fn) {
65+
function mapValues(obj, fn) {
6566
const res = {}
6667
Object.keys(obj).forEach(key => {
6768
res[key] = fn(obj[key], key)

dist/vue-create-api.esm.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ function apiCreator(Component) {
298298
return api;
299299
}
300300

301-
function index (Vue) {
301+
function install(Vue) {
302302
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
303303
var _options$componentPre = options.componentPrefix,
304304
componentPrefix = _options$componentPre === undefined ? '' : _options$componentPre,
@@ -333,4 +333,9 @@ function processComponentName(Component, options) {
333333
return camelizeName;
334334
}
335335

336+
var index = {
337+
install: install,
338+
version: '1.0.0'
339+
};
340+
336341
export default index;

dist/vue-create-api.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@
304304
return api;
305305
}
306306

307-
function index (Vue) {
307+
function install(Vue) {
308308
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
309309
var _options$componentPre = options.componentPrefix,
310310
componentPrefix = _options$componentPre === undefined ? '' : _options$componentPre,
@@ -339,6 +339,11 @@
339339
return camelizeName;
340340
}
341341

342+
var index = {
343+
install: install,
344+
version: '1.0.0'
345+
};
346+
342347
return index;
343348

344349
})));

dist/vue-create-api.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/index.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { camelize, escapeReg, isBoolean } from './util'
22
import { assert } from './debug'
33
import apiCreator from './creator'
44

5-
export default function (Vue, options = {}) {
5+
function install(Vue, options = {}) {
66
const {componentPrefix = '', apiPrefix = '$create-'} = options
77

88
Vue.createAPI = function (Component, events, single) {
@@ -29,3 +29,8 @@ function processComponentName(Component, options) {
2929
let camelizeName = `${camelize(`${apiPrefix}${pureName}`)}`
3030
return camelizeName
3131
}
32+
33+
export default {
34+
install,
35+
version: '__VERSION__'
36+
}

0 commit comments

Comments
 (0)