-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WIP: use class format and add all the tests #2
Conversation
@@ -1,30 +1,73 @@ | |||
// @ts-ignore | |||
import { getSource, getTarget, getSynths, getUsers, toBytes32 } from 'synthetix/browser'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This works with the browser example when I import from the browser file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure how to get it working for node now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I keep getting ReferenceError: window is not defined
for the builds
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So you shouldn't need to specify browser
here. Webpack et al will figure out if you are doing a browser based webpack to use the browser
field from the synthetix
package.json
. Likewise if you happen to be doing a node based bundle (which I loathe but necessary if you want to use TypeScript or ES modules), then it will use the main
field in the synthetix
package.json
@@ -0,0 +1,44 @@ | |||
const synthetix = require('../build/index.js')(async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be really nice to be able to run this without requiring a bundler. Perhaps ts-node
can do it? But ts-node
should only be a devDependency
in this case
No description provided.