Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,11 @@ var
// Adds on the fly methods promisification
Kuzzle.prototype.bluebird = bluebird;

if (typeof window !== 'undefined' && typeof BUILT === 'undefined') {
throw new Error('It looks like you are using the Nodejs version of Kuzzle SDK ' +
'in a browser. ' +
'It is strongly recommended to use the browser-specific build instead. ' +
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we now throw an error, we are more than "strongly recommending" to use the built-version of the SDK. :-)

'Learn more at https://github.com/kuzzleio/sdk-javascript/tree/master#browser');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I cannot find that anchor in our README file, either in master, 5.x or 6.x

Copy link

@ballinette ballinette Sep 28, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the anchor in the README is #javascript : https://github.com/kuzzleio/sdk-javascript#javascript
should rather be #browser, imho, so the link here is correct, bug we need to fix the Readme.

Copy link
Contributor Author

@xbill82 xbill82 Oct 2, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

}

module.exports = Kuzzle;
3 changes: 2 additions & 1 deletion webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ module.exports = {
new webpack.optimize.OccurenceOrderPlugin(),
new webpack.DefinePlugin({
global: 'window',
SDKVERSION: JSON.stringify(version)
SDKVERSION: JSON.stringify(version),
BUILT: true
}),
new webpack.BannerPlugin('Kuzzle javascript SDK version ' + version),
new webpack.optimize.UglifyJsPlugin({
Expand Down