iTowns / itowns_app_examples

Examples of setup to use iTowns in your own application
1 stars 2 forks source link

webpack library sample #1

Open mbredif opened 6 years ago

mbredif commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

following your tips, I made some progress :

but:

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

It is too much detailed...