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

Begin compiling source files together using Browserify #10

Closed
jywarren opened this issue Jun 7, 2017 · 4 comments
Closed

Begin compiling source files together using Browserify #10

jywarren opened this issue Jun 7, 2017 · 4 comments
Milestone

Comments

@jywarren
Copy link
Member

jywarren commented Jun 7, 2017

Does this make sense as a request? See how in the demo, you still need to include src/location_tags.js and each other source file? The ideal is that we would be able to use Browserify and then you can link your separate source files together using require('sourcefile.js') -- and then we'd only need to include a single file in the HTML.

I suggested a step here that would need Browserify to be working in order to be possible: https://github.com/publiclab/leaflet-blurred-location/pull/8/files#r120509041

Maybe @aspriya and @ryzokuken and you could talk a bit about how this works in their libraries.

@aspriya is already using Browserify in https://github.com/publiclab/inline-markdown-editor#contributing -- see how it has docs as follows (which we should replicate into this repository too):

Make changes to the files in the /src/ directory, then run grunt build to compile into /dist/inlineMarkdownEditor.js. This will use grunt-browserify to concatenate and include any node modules named in require() statements. You'll then be able to try it out in /examples/index.html. Run grunt and leave it running to build as you go.

This is already set up in your Gruntfile, see: https://github.com/publiclab/leaflet-blurred-location/blob/master/Gruntfile.js

But it looks like your /dist/Leaflet.BlurredLocation.js is not compiling properly.

Actually the tests should be running against the compiled code, not the source code; see how in this repository it's pointed at the source code (/src/*.js):

https://github.com/publiclab/leaflet-blurred-location/blob/master/Gruntfile.js#L41

But in inline-markdown-editor, it's pointed at dist/*.js:

https://github.com/publiclab/inline-markdown-editor/blob/master/Gruntfile.js#L36

Just needs some tweaks to address these issues and you'll be good to start using require() statements!

@mridulnagpal
Copy link
Member

@jywarren The example html page is example.html rather than index.html

@jywarren
Copy link
Member Author

jywarren commented Jun 8, 2017

@mridulnagpal
Copy link
Member

mridulnagpal commented Jun 8, 2017 via email

@jywarren
Copy link
Member Author

Complete in #7!

@jywarren jywarren modified the milestone: Basic setup Jun 17, 2017
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

2 participants