Skip to content

Commit 4e22489

Browse files
committed
Workaround mysterious HTMLWidgets scaffold problem related to webpack externs
1 parent a3acd8f commit 4e22489

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

srcjs/widget.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import HTMLWidgets from 'htmlwidgets';
2-
31
/**
42
* Recursively transforms tag, a JSON representation of an instance of a
53
* React component and its children, into a React element suitable for
@@ -77,7 +75,7 @@ export function isTag(value) {
7775
*/
7876
export function reactWidget(name, type, components, options) {
7977
var actualOptions = mergeOptions(options);
80-
HTMLWidgets.widget({
78+
window.HTMLWidgets.widget({
8179
name: name,
8280
type: type,
8381
factory: function (el, width, height) {

webpack.config.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@ module.exports = {
2222
'react': 'window.React',
2323
'react-dom': 'window.ReactDOM',
2424
'jquery': 'window.jQuery',
25-
'shiny': 'window.Shiny',
26-
'htmlwidgets': 'window.HTMLWidgets'
25+
'shiny': 'window.Shiny'
2726
},
2827
stats: {
2928
colors: true

0 commit comments

Comments
 (0)