Skip to content

Instantly share code, notes, and snippets.

@stuf
Created January 4, 2016 11:38
Show Gist options
  • Save stuf/cb02e699091de59750ac to your computer and use it in GitHub Desktop.
Save stuf/cb02e699091de59750ac to your computer and use it in GitHub Desktop.
`require` in JS file
var b = require('./b');
module.exports = {
a: 'success!',
b: b
};
module.exports = {
b: 'success!'
};
<App Theme="Basic">
<JavaScript File="a.js" ux:Global="Test" />
<JavaScript>
var Test = require('Test');
module.exports = {
Test: JSON.stringify(Test)
}
</JavaScript>
<Panel>
<Text Value="{Test}" />
</Panel>
</App>
ERROR:
Name: Error
ErrorMessage: require(): module not found: ./b
FileName: N/A
LineNumber: 0
JS StackTrace: Error: require(): module not found: ./b
at anonymous (/Users/stuf/Code/Home/fuse/test01/test01/a.js:1)
at anonymous (MainView:4)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment