Skip to content

Commit ee4f26e

Browse files
committed
Fix builds from non-compiled dependencies in cardboard-vr-display
1 parent a5d75ee commit ee4f26e

File tree

4 files changed

+11
-10
lines changed

4 files changed

+11
-10
lines changed

package-lock.json

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

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,6 @@
4646
"url": "https://github.com/immersive-web/webvr-polyfill/issues"
4747
},
4848
"dependencies": {
49-
"cardboard-vr-display": "1.0.7"
49+
"cardboard-vr-display": "1.0.9"
5050
}
5151
}

rollup.config.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@ export default {
4444
exclude: 'node_modules/**',
4545
}),
4646
resolve(),
47-
commonjs(),
47+
commonjs({
48+
include: ['src/**', 'node_modules/**'],
49+
}),
4850
cleanup(),
4951
],
5052
};

src/webvr-polyfill.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515

1616
import { extend, isMobile, race, copyArray } from './util';
1717
import CardboardVRDisplay from 'cardboard-vr-display';
18-
import { VRDisplay, VRFrameData } from 'cardboard-vr-display/src/base';
1918
import { version } from '../package.json';
2019
import DefaultConfig from './config';
2120

@@ -116,10 +115,10 @@ WebVRPolyfill.prototype.enable = function() {
116115
navigator.getVRDisplays = this.getVRDisplays.bind(this);
117116

118117
// Provide the `VRDisplay` object.
119-
window.VRDisplay = VRDisplay;
118+
window.VRDisplay = CardboardVRDisplay.VRDisplay;
120119

121120
// Provide the VRFrameData object.
122-
window.VRFrameData = VRFrameData;
121+
window.VRFrameData = CardboardVRDisplay.VRFrameData;
123122
};
124123

125124
WebVRPolyfill.prototype.getVRDisplays = function() {
@@ -152,7 +151,7 @@ WebVRPolyfill.prototype.getVRDisplays = function() {
152151
WebVRPolyfill.version = version;
153152

154153
// Attach polyfilled constructors
155-
WebVRPolyfill.VRFrameData = VRFrameData;
156-
WebVRPolyfill.VRDisplay = VRDisplay;
154+
WebVRPolyfill.VRFrameData = CardboardVRDisplay.VRFrameData;
155+
WebVRPolyfill.VRDisplay = CardboardVRDisplay.VRDisplay;
157156

158157
export default WebVRPolyfill;

0 commit comments

Comments
 (0)