Skip to content

Commit

Permalink
use separate config for browser build
Browse files Browse the repository at this point in the history
  • Loading branch information
JanST123 committed Jan 21, 2021
1 parent d5c637e commit 5094b2e
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ Then in your HTML you use

### In Node.js
```js
const gridscale = require("@gridscale/api");
const gridscale = require("@gridscale/api").gridscale;
const client = new gridscale.Client("[API-Token]", "[User-UUID]");
```

Expand Down
3 changes: 1 addition & 2 deletions example/dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
var process = require('process');
var colors = require('colors');

var gridscale = require('@gridscale/api');
var gridscale = require('@gridscale/api').gridscale;
var client;


Expand Down Expand Up @@ -13956,7 +13956,6 @@ exports.gridscale = gridscale;
var api_1 = require("./api");
Object.defineProperty(exports, "GSError", { enumerable: true, get: function () { return api_1.GSError; } });
__exportStar(require("./Specs"), exports);
module.exports = gridscale;



Expand Down
2 changes: 1 addition & 1 deletion example/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
var process = require('process');
var colors = require('colors');

var gridscale = require('@gridscale/api');
var gridscale = require('@gridscale/api').gridscale;
var client;


Expand Down
7 changes: 7 additions & 0 deletions src/index.browser.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/**
* Export all publicly accessible modules
*/
import * as gridscale from './client';


module.exports = gridscale;
2 changes: 0 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,3 @@ import * as gridscale from './client';
export { ApiResult, ApiSettings, BaseObject, BaseRelationObject, GenericApiResult, GSError, Links, LogData, Meta, RequestOptions, RequestPollResult, VoidApiResult } from './api';
export { gridscale };
export * from './Specs';

module.exports = gridscale;
2 changes: 1 addition & 1 deletion webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const path = require('path');

module.exports = {
context: path.resolve(__dirname, 'src'),
entry: './index.ts',
entry: './index.browser.ts',
mode: 'production',
module: {
rules: [{
Expand Down

0 comments on commit 5094b2e

Please sign in to comment.