Skip to content
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

Does it work in browser or just on node? #2

Open
cosmo-naut opened this issue Feb 6, 2018 · 16 comments
Open

Does it work in browser or just on node? #2

cosmo-naut opened this issue Feb 6, 2018 · 16 comments

Comments

@cosmo-naut
Copy link

No description provided.

@0x33467
Copy link
Contributor

0x33467 commented Feb 7, 2018

It should work on the browser @cosmo-naut

@cosmo-naut
Copy link
Author

cosmo-naut commented Feb 7, 2018 via email

@0x33467
Copy link
Contributor

0x33467 commented Feb 7, 2018

this is a reduced version of the ccv in order to reduce the size of the source files, I have a plan to release other algorithms on separated packages

@cosmo-naut
Copy link
Author

cosmo-naut commented Feb 7, 2018 via email

@0x33467
Copy link
Contributor

0x33467 commented Feb 7, 2018

no, just the LoadSWT should do the work...

@cosmo-naut
Copy link
Author

cosmo-naut commented Feb 7, 2018 via email

@0x33467
Copy link
Contributor

0x33467 commented Feb 7, 2018

I guess that you are able to browserify and it gets all the dependencies, otherwise I will try it and tell you later

@cosmo-naut
Copy link
Author

cosmo-naut commented Feb 7, 2018 via email

@0x33467
Copy link
Contributor

0x33467 commented Feb 7, 2018

are you using npm? or you are using only the repo, if you are using the repo you have to compile it (download the repo with it's submodules) and compile it, to have those folder, also you can run the test to check if it's ok (npm run test)

@0x33467
Copy link
Contributor

0x33467 commented Feb 7, 2018

to install it, you need to install emscripten, then you just have to compile using emmake make over the repo root (I will add to the readme how to compile it), if you use the npm package it contains the compiled sources on the ccv folder

@cosmo-naut
Copy link
Author

I am currently trying to use npm.
The folder in my node_modules folder only contains lib and src, am I doing it incorrectly?
I used the command npm install --save stroke-width-transform
Then when I attempt to browserify I use browserify loadSWT.js -o bundleSWT.js however it running into problems

@0x33467
Copy link
Contributor

0x33467 commented Feb 7, 2018

ok, just let me try, I guess that the dist folder is missing on the npm package...

@0x33467
Copy link
Contributor

0x33467 commented Feb 7, 2018

Hello, currently it should work, download the latest version on npm and try to run it.

I test it on runkit and it loads well: https://npm.runkit.com/stroke-width-transform

note: Actually the build on travis is failing because I got some error on the docker image from emscripten so don't pay attention to it...

@cosmo-naut
Copy link
Author

cosmo-naut commented Feb 7, 2018

Can confirm the new build has dist after an update.

I am currently getting the following error however:

node_modules\stroke-width-transform\src\index.js:1 import loadSWT from './loadSWT'; ^ ParseError: 'import' and 'export' may appear only with 'sourceType: module'

Googling the error and looking into other GitHubs, apparently there a couple of solutions but they may be specific to other applications. This one for instance says to add "parserOptions": { "sourceType": "module", } somewhere.

This might also have something to do with it, maybe it'll help. All of this is a little out of my knowledge at the moment, I'm not sure what the relationship between all of these various softwares is

@0x33467
Copy link
Contributor

0x33467 commented Feb 10, 2018

it's weird because it should load the module using the index that is on the 'lib' folder, and in that folder there's no import and export

@yorrd
Copy link

yorrd commented Apr 24, 2018

@cosmo-naut @JeffersonH44 I just built the source folder with babel and referenced src/index.js manually. Works fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants