Skip to content

Commit de697e0

Browse files
committed
fix: bundle dependencies and fix es build
1 parent 03b4423 commit de697e0

File tree

4 files changed

+7
-19
lines changed

4 files changed

+7
-19
lines changed

package.json

+2-4
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,6 @@
1212
"README.md",
1313
"dist/index.d.ts"
1414
],
15-
"dependencies": {
16-
"dom-event-types": "^1.0.0",
17-
"lodash": "^4.17.15"
18-
},
1915
"devDependencies": {
2016
"@babel/core": "^7.9.0",
2117
"@babel/preset-env": "^7.8.4",
@@ -28,6 +24,7 @@
2824
"@types/jest": "^24.9.1",
2925
"@types/lodash": "^4.14.149",
3026
"@types/node": "12.12.35",
27+
"@vue/compiler-dom": "^3.0.0-beta.10",
3128
"@vue/compiler-sfc": "^3.0.0-beta.10",
3229
"babel-jest": "^25.2.3",
3330
"babel-preset-jest": "^25.2.1",
@@ -49,6 +46,7 @@
4946
},
5047
"peerDependencies": {
5148
"@vue/compiler-sfc": "^3.0.0-beta.10",
49+
"@vue/compiler-dom": "^3.0.0-beta.10",
5250
"vue": "^3.0.0-beta.10"
5351
},
5452
"author": {

rollup.config.js

+3-8
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@ function createEntry(options) {
2525
input,
2626
external: [
2727
'vue',
28-
'lodash/mergeWith',
29-
'lodash/isString'
28+
'@vue/compiler-dom'
3029
],
3130
plugins: [
3231
replace({
@@ -41,23 +40,20 @@ function createEntry(options) {
4140
format,
4241
globals: {
4342
vue: 'Vue',
43+
'@vue/compiler-dom': 'VueCompilerDOM',
4444
'lodash/mergeWith': '_.mergeWith',
4545
'lodash/isString': '_.isString',
4646
}
4747
}
4848
}
4949

50-
if (['es', 'cjs'].includes(format)) {
51-
config.external.push('dom-event-types')
52-
}
53-
5450
if (format === 'es') {
5551
config.output.file = isBrowser ? pkg.browser : pkg.module
5652
}
5753
if (format === 'cjs') {
5854
config.output.file = pkg.main
5955
}
60-
console.log('file is', config.output.file)
56+
console.log(`Building ${format}: ${config.output.file}`)
6157

6258
config.plugins.push(
6359
ts({
@@ -78,7 +74,6 @@ function createEntry(options) {
7874

7975
export default [
8076
createEntry({ format: 'es', input: 'src/index.ts', isBrowser: false }),
81-
createEntry({ format: 'es', input: 'src/index.ts', isBrowser: true }),
8277
createEntry({ format: 'iife', input: 'src/index.ts', isBrowser: true }),
8378
createEntry({ format: 'cjs', input: 'src/index.ts', isBrowser: false }),
8479
]

src/create-dom-event.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import * as eventTypes from 'dom-event-types'
1+
import eventTypes from 'dom-event-types'
22

33
interface TriggerOptions {
44
code?: String

yarn.lock

+1-6
Original file line numberDiff line numberDiff line change
@@ -1204,7 +1204,7 @@
12041204
estree-walker "^0.8.1"
12051205
source-map "^0.6.1"
12061206

1207-
1207+
"@vue/[email protected]", "@vue/compiler-dom@^3.0.0-beta.10":
12081208
version "3.0.0-beta.10"
12091209
resolved "https://registry.yarnpkg.com/@vue/compiler-dom/-/compiler-dom-3.0.0-beta.10.tgz#5b35df447eb96cb7faed37b76a8a9aca71a87c67"
12101210
integrity sha512-S1Qqc74Hc3BnHjORzWJvG4Fj5B4O8aqTF1Oyd+Px65CB6qkbAaqTLneYnM5by/78j8inmt4FCHOf48L+gzChRA==
@@ -2220,11 +2220,6 @@ dir-glob@^2.2.2:
22202220
dependencies:
22212221
path-type "^3.0.0"
22222222

2223-
dom-event-types@^1.0.0:
2224-
version "1.0.0"
2225-
resolved "https://registry.yarnpkg.com/dom-event-types/-/dom-event-types-1.0.0.tgz#5830a0a29e1bf837fe50a70cd80a597232813cae"
2226-
integrity sha512-2G2Vwi2zXTHBGqXHsJ4+ak/iP0N8Ar+G8a7LiD2oup5o4sQWytwqqrZu/O6hIMV0KMID2PL69OhpshLO0n7UJQ==
2227-
22282223
domexception@^1.0.1:
22292224
version "1.0.1"
22302225
resolved "https://registry.yarnpkg.com/domexception/-/domexception-1.0.1.tgz#937442644ca6a31261ef36e3ec677fe805582c90"

0 commit comments

Comments
 (0)