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

webpack library sample #1

Open
mbredif opened this issue Apr 27, 2018 · 2 comments
Open

webpack library sample #1

mbredif opened this issue Apr 27, 2018 · 2 comments

Comments

@mbredif
Copy link

mbredif commented Apr 27, 2018

Would it be possible to create a third version that would show a template to quickstart an itowns plugin/library (rather than an application) ?

I am not sure about the difference, but @autra, you seemed to be knowledgeable about this when you say :

From this formulation, I understand that you wanted to write a library, but your repo looks like an app (build results and bundles committed, no peer dependencies, a webpack config, a preinstall script etc).

@autra
Copy link
Contributor

autra commented Apr 27, 2018

You're not far though: you just need to remove your MainBundle.js from the package imo and control more tightly what goes into your package when you run npm pack. Some deps should be in peerDependencies as well (like itowns, and maybe THREE). Tip, if you want it to still work in your examples, you also add your peerDependency in your devDependencies.

In short it's mainly a matter of configuring package.json. Not sure if this is the place, the npm documentation is already quite detailed on this :-)

@mbredif
Copy link
Author

mbredif commented Apr 27, 2018

following your tips, I made some progress :

  • I have no file: dependency anymore but "ros3d": "git+https://github.com/mbredif/ros3djs.git#es6"
  • itowns seems not to be bundled anymore (itowns is undefined if I have only the script tag for itowns-ros)
  • itowns-ros is published on npm

but:

  • itowns-ros.js is still pretty big (three is still bundled for some reason, surely because of ros3d)
  • I am still not sure if I am doing it right or not (looks like black magic to me)

Not sure if this is the place, the npm documentation is already quite detailed on this :-)

It is too much detailed...

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