Skip to content
This repository has been archived by the owner on Dec 26, 2018. It is now read-only.

Apply hotfix to support SSR (Fixes #92) #99

Open
wants to merge 2 commits into
base: next
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 20 additions & 8 deletions dist/vue-touch.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/vue-touch.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/vue-touch.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 9 additions & 1 deletion src/component.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
import Hammer from 'hammerjs'
let Hammer
// Client-side
try {
Hammer = require('hammerjs')
}
// SSR, pass empty stub
catch (err) {
Hammer = {}
}

import {
createProp,
Expand Down
10 changes: 9 additions & 1 deletion src/utils.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
import Hammer from 'hammerjs' // used by guardDirections
let Hammer
// Client-side
try {
Hammer = require('hammerjs')
}
// SSR, pass empty stub
catch (err) {
Hammer = {}
}

/**
* Tiny Object.assign replacement
Expand Down