SFS2X with Webpack

Post here your questions about the HTML5 / JavaScript for SFS2X

Moderators: Lapo, Bax

gopalrgpl
Posts: 11
Joined: 27 Mar 2018, 05:00

Re: SFS2X with Webpack

Postby gopalrgpl » 10 Apr 2018, 16:23

Bax wrote:The new version of the API (1.7.10) is now available here: http://www.smartfoxserver.com/download/sfs2x#p=client
We also published the NPM package here: https://www.npmjs.com/package/sfs2x-api


Thank you for the support
gopalrgpl
Posts: 11
Joined: 27 Mar 2018, 05:00

Re: SFS2X with Webpack

Postby gopalrgpl » 11 Apr 2018, 05:11

Bax wrote:The new version of the API (1.7.10) is now available here: http://www.smartfoxserver.com/download/sfs2x#p=client
We also published the NPM package here: https://www.npmjs.com/package/sfs2x-api



The package is good and working fine,

a small suggestion for the next release through npm.

Now the installed npm package contains the api file named as sfs2x-api-1.7.10.js, due to this the developer has to change the code manually

( for example if new release 1.7.11 is available , the developer has to change the version in bundler file(webpack,gulp ,grunt etc)
)

requiring the package every time, when smartfox updates its JavaScript library, so reducing the name to sfs2x-api.js would be great for next release of the library.
User avatar
Bax
Site Admin
Posts: 4609
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Re: SFS2X with Webpack

Postby Bax » 11 Apr 2018, 07:07

Actually I think you can import the library using the package name, instead of the file name.
We are using the following and it works fine (at least in webpack):

Code: Select all

import * as SFS2X from "sfs2x-api";
Paolo Bax
The SmartFoxServer Team
gopalrgpl
Posts: 11
Joined: 27 Mar 2018, 05:00

Re: SFS2X with Webpack

Postby gopalrgpl » 11 Apr 2018, 07:21

Bax wrote:Actually I think you can import the library using the package name, instead of the file name.
We are using the following and it works fine (at least in webpack):

Code: Select all

import * as SFS2X from "sfs2x-api";


Yeah its working in webpack thanks.
for pure javascript developers have to go in the above way i said.
Any way thanks for the support.

Return to “SFS2X HTML5 / JavaScript API”

Who is online

Users browsing this forum: No registered users and 12 guests