Friday, 19 June 2020

Multi-Page NodeJS Application with LWC

38


LWC open source application supports only single-page applications and there is no config attribute in lwc-services.config.js which enable us to make our app multi-page.

In a single-page application, LWC takes a single entry point as index.js and merges it with index.html to generate a final html file.

Structure of single page LWC project is as follows :



But our requirement was to implement multi-page application which can have structure as follows :



After doing some research my team and I found a solution which uses a custom webpack configuration file. We found out that there is an attribute ‘-w’ for lwc-services watch, lwc-services build commands. It takes the location of a custom webpack configuration file, which will be merged into the default config.

In that custom webpack configuration file, we need to provide multiple entries. An entry point indicates which module webpack should use to begin building out its internal dependency graph. webpack will figure out which other modules and libraries that entry point depends on (directly and indirectly).

Also we can use plugins which are used to customize the build process in a variety of ways. While loaders are used to transform certain types of modules, plugins can be leveraged to perform a wider range of tasks like bundle optimization, asset management and injection of environment variables.

Also we need to provide a module resolver which allows us to access modules in our js files. A resolver is a library which helps in locating a module by its absolute path. A module can be required as a dependency from another module.
After reading the above resources, we can write our own custom webpack configuration file which can be used to build LWC open source app which will run as a multi-page application as follows :



Yuvraj Lohiya
Senior Technical Lead 
iBirds Software Services Pvt. Ltd.

For more details on this topic you can contact us on : yuvraj.lohiya@ibirdsservices.com aslam.bari@ibirdsservices.com

  




38 comments:

  1. This comment has been removed by the author.

    ReplyDelete
  2. Thanks for sharing
    Leanpitch provides online training in DevOps during this lockdown period everyone can use it wisely.
    DevOps Online Training

    ReplyDelete
  3. click here to know about AWS CLI completely. This is the best platform to improve your aws skills.

    ReplyDelete
  4. Awesome post! Personally I like your site. . I am so impressed to read your content. I am looking forward for the next valuable and informative concept in your blog. Overall outstanding post. Carry on :) Well done!
    If you want Digital Marketing Serives :-
    Digital marketing Service in Delhi
    SMM Services
    PPC Services in Delhi
    Website Design & Development Packages
    SEO Services PackagesLocal SEO services
    E-mail marketing services
    YouTube plans

    ReplyDelete
  5. Your information is really good and definitely that things are very useful. I'm impressed with your pleas to share much information with us.
    construction logistics services London

    ReplyDelete
  6. This article content is really unique and amazing. This article really helpful and explained very well's i am really thankful to you for sharing keep it up..

    Digital Marketing Service in Kanpur

    ReplyDelete
  7. I really want to thank the author for such a nice blog that helped me to understand why it is important. Email Marketing Services in Perth

    ReplyDelete
  8. This article's content is really unique and amazing. This article really helpful and explained very well. So I am really thankful to you for sharing keep it up..

    หวยออนไลน์จ่ายจริง

    ReplyDelete
  9. This article content is really unique and amazing.This article really helpful and explained very well.So i am really thankful to you for sharing keep it up..

    Digital Marketing Services

    ReplyDelete
  10. Amazingly helpful which you have shared here. I am impressed by the details and also it is a significant article for us. Continue imparting this sort of info, Thank you.smm panel

    ReplyDelete
  11. Hi,
    Thanks for the nice blog. It was very useful for me. keep sharing ! if want Trademark Registration in bangalore Income Tax Consultants in bangalore click on it

    ReplyDelete
  12. Thanks for sharing this information GIOSTAR is one of the best stem cell therapy in India. GIOSTAR has a capacity to treat a few destroying Immunological infirmities and Blood related infections. These unite Diabetes Type I and Type II, Lupus, Multiple Sclerosis, Crohn's burden, Vasculitis, Scleroderma, Myasthenia Gravis, Sickle Cell Anemia, Leukemia, Lymphoma, Thalassemia and building up the treatments for Alzheimer's, Autism, Anti-Aging Treatments, Parkinson's infection, Cancer, Heart and Retinal Degeneration, Amyotrophic Lateral Sclerosis, Neuropathy, Osteoarthritis, Paralysis, Strokes, Spinal Cord Injuries, Skin Burns and Spinal Muscular Atrophy (SMA). BestStem Cell Therapy in India, Hyderabad, Delhi, Bangalore,

    ReplyDelete
  13. This site helps to clear your all query.
    This is really worth reading. nice informative article.
    uniraj exam time table

    ReplyDelete
  14. You have done great work by publishing this article here. It is useful and convenient info for us.cheap smm panel . Keep upgrading our knowledge by share these types of articles.  First Smm Panel

    ReplyDelete
  15. I prefer high-quality content, which I discovered in your article about Smm Panel Services. The information you've provided is useful and important to us. Continue to post articles like these. Thank you very much.

    ReplyDelete
  16. Thank you so much for taking the time to write such an interesting article. Thank you for sharing how you're doing it; I'm sure the material you provided will be of great use to many individuals.

    digital marketing training in hyderabad

    ReplyDelete
  17. Excellent knowledge, You are providing important knowledge. It is really helpful and factual information for us and everyone to increase knowledge. Continue sharing your data. Thank you. Best SMM Panel Service Provider

    ReplyDelete
  18. Emblix Academy – Digital marketing institute in KPHB, we address all major and minor aspects required for any student’s advancement in digital marketing. Clutch USA named our Digital Marketing Institute the best SEO firm. for more info visit here :- https://emblixacademy.com/

    ReplyDelete
  19. Really, this is very important information which is shared by you. This info is meaningful and important for everyone to increase our knowledge about it. Always keep sharing this kind of info. Thank you. Read more info about SMM Panel Reseller India

    ReplyDelete
  20. EMBLIX is a leading Digital Marketing Agency in Hyderabad offering a wide range of services including Digital Marketing, SEO, Social media marketing, Google AdWords, Facebook ads, and website designing. We offer comprehensive and customized services for our clients. Emblix as one of the best and top most service-oriented Digital Marketing Company in Hyderabad and India. One of the best SEO companies in Hyderabad, strive hard to provide all-encompassing digital marketing services along with web design and development. Emblix’s extensive market experience and expertise in Digital Marketing helps clients in successfully managing data as a strategic asset.

    ReplyDelete
  21. this kind of info. Thank you. Read more info about Best smm panel

    ReplyDelete
  22. Wow i can say that this is another great article as expected of this blog.Bookmarked this site.. top smm panel

    ReplyDelete
    Replies
    1. Wow i can say that this is another great article as expected of this blog.Bookmarked this site.. top smm panel

      Delete
  23. This is a wonderful article, Given so much info in it, These type of articles keeps the users interest in the website, and keep on sharing more ... good luck buy real instagram followers

    ReplyDelete
  24. More appreciating blog and this is Great post for me. It looks extremely good and Maintain a good job. SMM Panel Reseller India

    ReplyDelete
  25. This is a wonderful article, Given so much info in it
    Pesco Online Bill

    ReplyDelete
  26. This comment has been removed by the author.

    ReplyDelete
  27. Thanks for sharing this information. Keep it up.

    ReplyDelete
  28. Thanks for sharing useful information. We have learned so much information from your blog. Keep sharing. We are also providing the best services click on below links to visit our website.
    Oracle Fusion HCM Training
    Workday Training
    Okta Training
    Palo Alto Training
    Adobe Analytics Training

    ReplyDelete