Comments (4)
The CLI only watches the src
and static
folder and settings.json
. If you use external libraries in your app, I suggest you put them in src/libs
.
Watching the node modules
folder doesn't sound like a good idea for performance reasons.
from lightning-cli.
Thanks for the support.
I want to share my idea:
Share class
definitions between node
server
and Lightining
Front End.
So my classes, for example Player
may have the responsability of communicate with his REST API (CRUD his self).
So a Player
should be instancieted or received by a Component
(ex the PlayerPosition
), shared between components but also manipulated by the server and even saved in a database.
I'm not thinking about external libraries but my custom business logic definition.
You think that a Front End project not have to contain custom classes but only Components
?
Even for Utils
functions (for example the function that find the winner) should be good if It should be shared with the server and so mantained in one place only.
I'm looking for a way to share these classes in order to be DRY...
It's reasonable?
The best thing I think is to release those definitions as modules and then import them as dependecies in both server and client projects.
Now they are in a shared folder and I'm restarting both server
and lng
processes mannually every time is needed.
Best regards
Mattia
from lightning-cli.
In general it seems like a good idea to share generic code between the front-end and the backend yes.
As for the CLI rebuilding your front-end project when any of these shared class definitions change, you have the following options:
- place the files inside your front-end’s
src/shared
folder (easiest, but not very semantic) - keep the files outside of the front-end and create a symlink into your App’s
src
folder - that should also trigger a change in the watcher I believe - restart the watch / build commands manually whenever a generic file changes
from lightning-cli.
Thanks for the support.
I recognise that is not a CLI issue so it is closable for me.
Best regards
Mattia
from lightning-cli.
Related Issues (20)
- Support for ECMAScript 2020 features HOT 1
- Extend rollup configuration HOT 1
- Build error from esbuild when there is a dependency on crypto-js HOT 2
- LNG_LIVE_RELOAD missing in documentation HOT 1
- Husky's pre-commit hook is not working after `lng create` HOT 1
- App Identifier error while Uploading the code to Metrological HOT 1
- CLI CI/CD Compatibility ( lng upload ) HOT 1
- App bundle created with esbuild is not exposing a constructor HOT 1
- .gitignore getting written every time we run a build HOT 3
- _states() is broken for esbuild bundle when NODE_ENV=production HOT 2
- Allow using a different .env than the one on the root folder HOT 3
- `process` is not defined when `LNG_BUNDLER=esbuild` HOT 1
- Issue with CLI : HOT 3
- Build fails due to path to rollup being incorrect HOT 1
- LNG DIST ignores esEnv parameter in settings.json HOT 2
- Create generates App.js with License in it HOT 8
- Sourcemap not generating by default when we use esbuild bundler
- Please implement lng dev option to not open a browser window each time it is run. HOT 2
- [ENV Variables] Process is undefined when trying to access Environment variables with Rollup
- Sourcemaps in production? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lightning-cli.