Skip to content
This repository has been archived by the owner on Oct 12, 2022. It is now read-only.

Can we have an example that builds a node package of components for use in a SPA #142

Open
SteveALee opened this issue Apr 24, 2017 · 3 comments

Comments

@SteveALee
Copy link

SteveALee commented Apr 24, 2017

Reading through the docs and googling I've yet to find a good example of this. The main clarification needed is what TSC options to use in the package creation when it's not for use by node but using node as the dev platform in a bundler/transpiler like webpack. The package should then be usable from TS or javascript (do will be JS + typingsm not ts files). Ideally a UMD version would be included for use from browser global scripts

My exact use case is to create a set of TS components released as a npm package that can be used when building a SPA style app using webpack which also use TS. In other words, need to build and consume a TS module that is published via npm and used in code transpiled to ES5 to run in a web conext (TS + babel using webpack).

I'm actually using CycleJS but I'd be happy for an extended version of the react example that uses a separately published package for part of it's functionality.

I've no doubt this is easy to achieve but so far I have failed. Even pointer to an example would be useful

Thanks

@SteveALee
Copy link
Author

@mhegazy
Copy link
Contributor

mhegazy commented Apr 24, 2017

Is this useful?

@SteveALee
Copy link
Author

@mhegazy Thanks - that's actually the easier part of the problem. I was getting stuck on providing some of the modules in a separate npm package and getting the module resolution and typings to work properly.

It turned out to be some simple config issue. But given the many options I do think an "official" example here would be good. it doesn't actually have to be a UI consuming the package, that's my usecase.

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

No branches or pull requests

2 participants