Commit 53f503e7 authored by Fabien's avatar Fabien Committed by GitHub

Merge pull request #211 from steemit/change/use-a-js-file-for-methods

Remove usage of JSON files in steem-js
parents 5077121e d52e5394
...@@ -2,23 +2,6 @@ ...@@ -2,23 +2,6 @@
This is a demo of `steem-js` and webpack usage targetting both the Web and This is a demo of `steem-js` and webpack usage targetting both the Web and
Node.js platforms. Node.js platforms.
## Minimal configuration
`steem-js` requires JSON files internally, so you need JSON loader configured:
```json
{
...
module: {
loaders: [
{ test: /\.json$/, loader: 'json-loader'},
]
}
...
}
```
Make sure `resolve.extensions` and `json-loader`'s `module.loaders[...].exclude`
do not exclude `.json` files or `node_modules` from resolving.
## Compiling the example ## Compiling the example
Compiling for the web (`bundle.js`, which you can test with `open index.html`): Compiling for the web (`bundle.js`, which you can test with `open index.html`):
``` ```
......
...@@ -6,7 +6,7 @@ module.exports = { ...@@ -6,7 +6,7 @@ module.exports = {
}, },
module: { module: {
loaders: [ loaders: [
{ test: /\.json$/, loader: 'json-loader'}, // { test: /\.json$/, loader: 'json-loader'},
] ]
}, },
} }
{ {
"name": "steem", "name": "steem",
"version": "0.6.0", "version": "0.6.1",
"description": "Steem.js the JavaScript API for Steem blockchain", "description": "Steem.js the JavaScript API for Steem blockchain",
"main": "lib/index.js", "main": "lib/index.js",
"scripts": { "scripts": {
......
[ module.exports = [
{ {
"api": "database_api", "api": "database_api",
"method": "set_subscribe_callback", "method": "set_subscribe_callback",
...@@ -492,4 +492,4 @@ ...@@ -492,4 +492,4 @@
"method": "get_market_history_buckets", "method": "get_market_history_buckets",
"params": [] "params": []
} }
] ];
...@@ -3,7 +3,7 @@ import newDebug from 'debug'; ...@@ -3,7 +3,7 @@ import newDebug from 'debug';
import broadcastHelpers from './helpers'; import broadcastHelpers from './helpers';
import formatterFactory from '../formatter'; import formatterFactory from '../formatter';
import operations from './operations.json'; import operations from './operations';
import steemApi from '../api'; import steemApi from '../api';
import steemAuth from '../auth'; import steemAuth from '../auth';
import { camelCase } from '../utils'; import { camelCase } from '../utils';
......
[ module.exports = [
{ {
"roles": ["posting"], "roles": ["posting"],
"operation": "vote", "operation": "vote",
...@@ -493,4 +493,4 @@ ...@@ -493,4 +493,4 @@
"memo" "memo"
] ]
} }
] ];
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment