Code Monkey home page Code Monkey logo

aspnetcore-multi-spa-template-react's Introduction

aspnetcore-multi-spa-template-react

Multi-SPA React Template for Asp.Net Core 2.1+, WebPack 4.0+. Supports Bundle/Code splitting, hashing and injection into ASP.NET views

About

ASP.NET Core project template/tooling for multi-SPAs within a ServerSide ASP.NET Core solution. E.g: Create separate React apps to be injected into different server-side views (.cshtml) within a single solution.

Background

The new React SPA templates from Microsoft (2.1+) only supports Create-React-App based template with no automatic bundle injection into the server side code.

This project template supports non-CRA based React apps within .net core project, with automatic bundle/code spliting and injection into server side views.

Features

  • WebPack 4.0+
  • React 16+
  • Typescript
  • Automatic bundle/code spliting (JS/CSS)
  • Automatic bundle injection (hash) into server side views
  • Multi app support
  • Hot Module Reloading with Integrated Development Server.
  • ASP.NET core ise used for server-side API access, server side routing of SPAs.
  • wwwroot/dist based deployment

How to use

Clone the repo. Open the .sln in Visual Studio. Hit F5 to launch server side server at localhost:5000.

Open the ClientApp in Visual Studio Code. Run the Dev Server with 'npm run start'.

How to configure

Set up your app entrypoints, htmp-webpack-plugin templates, and server side inject views in project.json.

"entryPoints": [
		{
			"chunkName": "myApp1",
			"entryPoint": "./src/apps/myapp1/index.tsx",
			"htmlTemplateFile": "../views/home/myApp1_template.cshtml",
			"htmlOutputFile": "../views/home/myApp1.cshtml"
		},
		{
			"chunkName": "myApp2",
			"entryPoint": "./src/apps/myapp2/index.tsx",
			"htmlTemplateFile": "../views/home/myApp2_template.cshtml",
			"htmlOutputFile": "../views/home/myApp2.cshtml"
		}
	],

aspnetcore-multi-spa-template-react's People

Contributors

boraturant avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.