diff --git a/templates/AureliaSpa/Aurelia.xproj b/templates/AureliaSpa/Aurelia.xproj new file mode 100644 index 00000000..f83262ca --- /dev/null +++ b/templates/AureliaSpa/Aurelia.xproj @@ -0,0 +1,18 @@ + + + + 14.0 + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) + true + + + + 33d8dad9-74f9-471d-8bad-55f828faa736 + Aurelia + v4.5.2 + + + 2.0 + + + diff --git a/templates/AureliaSpa/ClientApp/app/components/app/app.css b/templates/AureliaSpa/ClientApp/app/components/app/app.css new file mode 100644 index 00000000..63926006 --- /dev/null +++ b/templates/AureliaSpa/ClientApp/app/components/app/app.css @@ -0,0 +1,6 @@ +@media (max-width: 767px) { + /* On small screens, the nav menu spans the full width of the screen. Leave a space for it. */ + .body-content { + padding-top: 50px; + } +} diff --git a/templates/AureliaSpa/ClientApp/app/components/app/app.html b/templates/AureliaSpa/ClientApp/app/components/app/app.html new file mode 100644 index 00000000..27cae10e --- /dev/null +++ b/templates/AureliaSpa/ClientApp/app/components/app/app.html @@ -0,0 +1,14 @@ + diff --git a/templates/AureliaSpa/ClientApp/app/components/app/app.ts b/templates/AureliaSpa/ClientApp/app/components/app/app.ts new file mode 100644 index 00000000..90f8712a --- /dev/null +++ b/templates/AureliaSpa/ClientApp/app/components/app/app.ts @@ -0,0 +1,17 @@ +import { Aurelia } from 'aurelia-framework'; +import { Router, RouterConfiguration } from 'aurelia-router'; + +export class App { + router: Router; + + configureRouter(config: RouterConfiguration, router: Router) { + config.title = 'Aurelia'; + config.map([ + { route: ['', 'home'], name: 'home', settings: {icon: 'home'}, moduleId: '../home/home', nav: true, title: 'Home' }, + { route: 'counter', name: 'counter', settings: {icon: 'education'}, moduleId: '../counter/counter', nav: true, title: 'Counter' }, + { route: 'fetch-data', name: 'fetchdata', settings: {icon: 'th-list'}, moduleId: '../fetchdata/fetchdata', nav: true, title: 'Fetch data' } + ]); + this.router = router; + } +} + \ No newline at end of file diff --git a/templates/AureliaSpa/ClientApp/app/components/counter/counter.html b/templates/AureliaSpa/ClientApp/app/components/counter/counter.html new file mode 100644 index 00000000..ef4bf8f3 --- /dev/null +++ b/templates/AureliaSpa/ClientApp/app/components/counter/counter.html @@ -0,0 +1,9 @@ + diff --git a/templates/AureliaSpa/ClientApp/app/components/counter/counter.ts b/templates/AureliaSpa/ClientApp/app/components/counter/counter.ts new file mode 100644 index 00000000..74d0d487 --- /dev/null +++ b/templates/AureliaSpa/ClientApp/app/components/counter/counter.ts @@ -0,0 +1,7 @@ +export class Counter { + public currentCount = 0; + + public incrementCounter() { + this.currentCount++; + } +} diff --git a/templates/AureliaSpa/ClientApp/app/components/fetchdata/fetchdata.html b/templates/AureliaSpa/ClientApp/app/components/fetchdata/fetchdata.html new file mode 100644 index 00000000..bd06c35d --- /dev/null +++ b/templates/AureliaSpa/ClientApp/app/components/fetchdata/fetchdata.html @@ -0,0 +1,26 @@ + diff --git a/templates/AureliaSpa/ClientApp/app/components/fetchdata/fetchdata.ts b/templates/AureliaSpa/ClientApp/app/components/fetchdata/fetchdata.ts new file mode 100644 index 00000000..cb52aafb --- /dev/null +++ b/templates/AureliaSpa/ClientApp/app/components/fetchdata/fetchdata.ts @@ -0,0 +1,25 @@ +/// +/// +import { HttpClient } from 'aurelia-fetch-client'; +import { inject } from 'aurelia-framework'; + +@inject(HttpClient) +export class Fetchdata { + public forecasts: WeatherForecast[]; + http: HttpClient; + + constructor(http: HttpClient) { + http.fetch('/api/SampleData/WeatherForecasts') + .then(result => result.json()) + .then(data => { + this.forecasts = data; + }); + } +} + +interface WeatherForecast { + dateFormatted: string; + temperatureC: number; + temperatureF: number; + summary: string; +} diff --git a/templates/AureliaSpa/ClientApp/app/components/home/home.html b/templates/AureliaSpa/ClientApp/app/components/home/home.html new file mode 100644 index 00000000..9d0474db --- /dev/null +++ b/templates/AureliaSpa/ClientApp/app/components/home/home.html @@ -0,0 +1,16 @@ + diff --git a/templates/AureliaSpa/ClientApp/app/components/home/home.ts b/templates/AureliaSpa/ClientApp/app/components/home/home.ts new file mode 100644 index 00000000..737d6cc2 --- /dev/null +++ b/templates/AureliaSpa/ClientApp/app/components/home/home.ts @@ -0,0 +1,2 @@ +export class Home { +} diff --git a/templates/AureliaSpa/ClientApp/app/components/navmenu/navmenu.css b/templates/AureliaSpa/ClientApp/app/components/navmenu/navmenu.css new file mode 100644 index 00000000..8518eda3 --- /dev/null +++ b/templates/AureliaSpa/ClientApp/app/components/navmenu/navmenu.css @@ -0,0 +1,59 @@ +li .glyphicon { + margin-right: 10px; +} + +/* Highlighting rules for nav menu items */ +li.au-target.link-active a, +li.au-target.link-active a:hover, +li.au-target.link-active a:focus { + background-color: #4189C7; + color: white; +} + +/* Keep the nav menu independent of scrolling and on top of other items */ +.main-nav { + position: fixed; + top: 0; + left: 0; + right: 0; + z-index: 1; +} + +@media (min-width: 768px) { + /* On small screens, convert the nav menu to a vertical sidebar */ + .main-nav { + height: 100%; + width: calc(25% - 20px); + } + .navbar { + border-radius: 0px; + border-width: 0px; + height: 100%; + } + .navbar-header { + float: none; + } + .navbar-collapse { + border-top: 1px solid #444; + padding: 0px; + } + .navbar ul { + float: none; + } + .navbar li { + float: none; + font-size: 15px; + margin: 6px; + } + .navbar li a { + padding: 10px 16px; + border-radius: 4px; + } + .navbar a { + /* If a menu item's text is too long, truncate it */ + width: 100%; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + } +} diff --git a/templates/AureliaSpa/ClientApp/app/components/navmenu/navmenu.html b/templates/AureliaSpa/ClientApp/app/components/navmenu/navmenu.html new file mode 100644 index 00000000..4b383169 --- /dev/null +++ b/templates/AureliaSpa/ClientApp/app/components/navmenu/navmenu.html @@ -0,0 +1,26 @@ + diff --git a/templates/AureliaSpa/ClientApp/boot.ts b/templates/AureliaSpa/ClientApp/boot.ts new file mode 100644 index 00000000..be7ff275 --- /dev/null +++ b/templates/AureliaSpa/ClientApp/boot.ts @@ -0,0 +1,11 @@ +import { Aurelia } from 'aurelia-framework'; +import 'bootstrap/dist/css/bootstrap.css'; +import 'bootstrap'; + +export function configure(aurelia: Aurelia) { + aurelia.use.standardConfiguration(); + if (window.location.host.includes('localhost')) { + aurelia.use.developmentLogging(); + } + aurelia.start().then(() => aurelia.setRoot('app/components/app/app')); +} diff --git a/templates/AureliaSpa/Controllers/HomeController.cs b/templates/AureliaSpa/Controllers/HomeController.cs new file mode 100644 index 00000000..9d75da88 --- /dev/null +++ b/templates/AureliaSpa/Controllers/HomeController.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Mvc; + +namespace WebApplicationBasic.Controllers +{ + public class HomeController : Controller + { + public IActionResult Index() + { + return View(); + } + + public IActionResult Error() + { + return View(); + } + } +} diff --git a/templates/AureliaSpa/Controllers/SampleDataController.cs b/templates/AureliaSpa/Controllers/SampleDataController.cs new file mode 100644 index 00000000..1f46d127 --- /dev/null +++ b/templates/AureliaSpa/Controllers/SampleDataController.cs @@ -0,0 +1,44 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Mvc; + +namespace WebApplicationBasic.Controllers +{ + [Route("api/[controller]")] + public class SampleDataController : Controller + { + private static string[] Summaries = new[] + { + "Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching" + }; + + [HttpGet("[action]")] + public IEnumerable WeatherForecasts() + { + var rng = new Random(); + return Enumerable.Range(1, 5).Select(index => new WeatherForecast + { + DateFormatted = DateTime.Now.AddDays(index).ToString("d"), + TemperatureC = rng.Next(-20, 55), + Summary = Summaries[rng.Next(Summaries.Length)] + }); + } + + public class WeatherForecast + { + public string DateFormatted { get; set; } + public int TemperatureC { get; set; } + public string Summary { get; set; } + + public int TemperatureF + { + get + { + return 32 + (int)(this.TemperatureC / 0.5556); + } + } + } + } +} diff --git a/templates/AureliaSpa/Dockerfile b/templates/AureliaSpa/Dockerfile new file mode 100644 index 00000000..c9bf07c1 --- /dev/null +++ b/templates/AureliaSpa/Dockerfile @@ -0,0 +1,17 @@ +FROM microsoft/dotnet:1.0.0-preview2-onbuild + +RUN apt-get update +RUN wget -qO- https://deb.nodesource.com/setup_4.x | bash - +RUN apt-get install -y build-essential nodejs + +WORKDIR /app + +COPY project.json . +RUN ["dotnet", "restore"] + +COPY . /app +RUN ["dotnet", "build"] + +EXPOSE 5000/tcp + +ENTRYPOINT ["dotnet", "run", "--server.urls", "http://0.0.0.0:5000"] diff --git a/templates/AureliaSpa/Program.cs b/templates/AureliaSpa/Program.cs new file mode 100644 index 00000000..b2e5e4b8 --- /dev/null +++ b/templates/AureliaSpa/Program.cs @@ -0,0 +1,31 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Hosting; +using Microsoft.Extensions.Configuration; + +namespace WebApplicationBasic +{ + public class Program + { + public static void Main(string[] args) + { + var config = new ConfigurationBuilder() + .AddCommandLine(args) + .AddEnvironmentVariables(prefix: "ASPNETCORE_") + .Build(); + + var host = new WebHostBuilder() + .UseConfiguration(config) + .UseKestrel() + .UseContentRoot(Directory.GetCurrentDirectory()) + .UseIISIntegration() + .UseStartup() + .Build(); + + host.Run(); + } + } +} diff --git a/templates/AureliaSpa/README.md b/templates/AureliaSpa/README.md new file mode 100644 index 00000000..d8ba0b38 --- /dev/null +++ b/templates/AureliaSpa/README.md @@ -0,0 +1,39 @@ +# Welcome to ASP.NET Core + +We've made some big updates in this release, so it’s **important** that you spend a few minutes to learn what’s new. + +You've created a new ASP.NET Core project. [Learn what's new](https://go.microsoft.com/fwlink/?LinkId=518016) + +## This application consists of: + +* Sample pages using ASP.NET Core MVC +* [Gulp](https://go.microsoft.com/fwlink/?LinkId=518007) and [Bower](https://go.microsoft.com/fwlink/?LinkId=518004) for managing client-side libraries +* Theming using [Bootstrap](https://go.microsoft.com/fwlink/?LinkID=398939) + +## How to + +* [Add a Controller and View](https://go.microsoft.com/fwlink/?LinkID=398600) +* [Add an appsetting in config and access it in app.](https://go.microsoft.com/fwlink/?LinkID=699562) +* [Manage User Secrets using Secret Manager.](https://go.microsoft.com/fwlink/?LinkId=699315) +* [Use logging to log a message.](https://go.microsoft.com/fwlink/?LinkId=699316) +* [Add packages using NuGet.](https://go.microsoft.com/fwlink/?LinkId=699317) +* [Add client packages using Bower.](https://go.microsoft.com/fwlink/?LinkId=699318) +* [Target development, staging or production environment.](https://go.microsoft.com/fwlink/?LinkId=699319) + +## Overview + +* [Conceptual overview of what is ASP.NET Core](https://go.microsoft.com/fwlink/?LinkId=518008) +* [Fundamentals of ASP.NET Core such as Startup and middleware.](https://go.microsoft.com/fwlink/?LinkId=699320) +* [Working with Data](https://go.microsoft.com/fwlink/?LinkId=398602) +* [Security](https://go.microsoft.com/fwlink/?LinkId=398603) +* [Client side development](https://go.microsoft.com/fwlink/?LinkID=699321) +* [Develop on different platforms](https://go.microsoft.com/fwlink/?LinkID=699322) +* [Read more on the documentation site](https://go.microsoft.com/fwlink/?LinkID=699323) + +## Run & Deploy + +* [Run your app](https://go.microsoft.com/fwlink/?LinkID=517851) +* [Run tools such as EF migrations and more](https://go.microsoft.com/fwlink/?LinkID=517853) +* [Publish to Microsoft Azure Web Apps](https://go.microsoft.com/fwlink/?LinkID=398609) + +We would love to hear your [feedback](https://go.microsoft.com/fwlink/?LinkId=518015) diff --git a/templates/AureliaSpa/Startup.cs b/templates/AureliaSpa/Startup.cs new file mode 100644 index 00000000..1d0256c7 --- /dev/null +++ b/templates/AureliaSpa/Startup.cs @@ -0,0 +1,68 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Hosting; +using Microsoft.AspNetCore.SpaServices.Webpack; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Logging; + +namespace WebApplicationBasic +{ + public class Startup + { + public Startup(IHostingEnvironment env) + { + var builder = new ConfigurationBuilder() + .SetBasePath(env.ContentRootPath) + .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true) + .AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true) + .AddEnvironmentVariables(); + Configuration = builder.Build(); + } + + public IConfigurationRoot Configuration { get; } + + // This method gets called by the runtime. Use this method to add services to the container. + public void ConfigureServices(IServiceCollection services) + { + // Add framework services. + services.AddMvc(); + } + + // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. + public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory) + { + loggerFactory.AddConsole(Configuration.GetSection("Logging")); + loggerFactory.AddDebug(); + + if (env.IsDevelopment()) + { + app.UseDeveloperExceptionPage(); + // Aurelia Webpack Plugin HMR currently has issues, leave the HotModuleReplacement setting as false + app.UseWebpackDevMiddleware(new WebpackDevMiddlewareOptions { + HotModuleReplacement = false + }); + } + else + { + app.UseExceptionHandler("/Home/Error"); + } + + app.UseStaticFiles(); + + app.UseMvc(routes => + { + routes.MapRoute( + name: "default", + template: "{controller=Home}/{action=Index}/{id?}"); + + routes.MapSpaFallbackRoute( + name: "spa-fallback", + defaults: new { controller = "Home", action = "Index" }); + }); + } + } +} diff --git a/templates/AureliaSpa/Views/Home/Index.cshtml b/templates/AureliaSpa/Views/Home/Index.cshtml new file mode 100644 index 00000000..f478d2f1 --- /dev/null +++ b/templates/AureliaSpa/Views/Home/Index.cshtml @@ -0,0 +1,8 @@ +@{ + ViewData["Title"] = "Home Page"; +} +
+@section scripts { + + +} diff --git a/templates/AureliaSpa/Views/Shared/Error.cshtml b/templates/AureliaSpa/Views/Shared/Error.cshtml new file mode 100644 index 00000000..473b35d6 --- /dev/null +++ b/templates/AureliaSpa/Views/Shared/Error.cshtml @@ -0,0 +1,6 @@ +@{ + ViewData["Title"] = "Error"; +} + +

Error.

+

An error occurred while processing your request.

diff --git a/templates/AureliaSpa/Views/Shared/_Layout.cshtml b/templates/AureliaSpa/Views/Shared/_Layout.cshtml new file mode 100644 index 00000000..aae273e8 --- /dev/null +++ b/templates/AureliaSpa/Views/Shared/_Layout.cshtml @@ -0,0 +1,13 @@ + + + + + + @ViewData["Title"] - Aurelia + + + @RenderBody() + + @RenderSection("scripts", required: false) + + diff --git a/templates/AureliaSpa/Views/_ViewImports.cshtml b/templates/AureliaSpa/Views/_ViewImports.cshtml new file mode 100644 index 00000000..e7b4f83f --- /dev/null +++ b/templates/AureliaSpa/Views/_ViewImports.cshtml @@ -0,0 +1,3 @@ +@using WebApplicationBasic +@addTagHelper "*, Microsoft.AspNetCore.Mvc.TagHelpers" +@addTagHelper "*, Microsoft.AspNetCore.SpaServices" diff --git a/templates/AureliaSpa/Views/_ViewStart.cshtml b/templates/AureliaSpa/Views/_ViewStart.cshtml new file mode 100644 index 00000000..820a2f6e --- /dev/null +++ b/templates/AureliaSpa/Views/_ViewStart.cshtml @@ -0,0 +1,3 @@ +@{ + Layout = "_Layout"; +} diff --git a/templates/AureliaSpa/appsettings.json b/templates/AureliaSpa/appsettings.json new file mode 100644 index 00000000..723c096a --- /dev/null +++ b/templates/AureliaSpa/appsettings.json @@ -0,0 +1,10 @@ +{ + "Logging": { + "IncludeScopes": false, + "LogLevel": { + "Default": "Debug", + "System": "Information", + "Microsoft": "Information" + } + } +} diff --git a/templates/AureliaSpa/package.json b/templates/AureliaSpa/package.json new file mode 100644 index 00000000..8bacd0bb --- /dev/null +++ b/templates/AureliaSpa/package.json @@ -0,0 +1,43 @@ +{ + "name": "AureliaSpa", + "version": "0.0.0", + "dependencies": { + "aurelia-bootstrapper-webpack": "^1.0.0", + "aurelia-event-aggregator": "^1.0.0", + "aurelia-fetch-client": "^1.0.0", + "aurelia-framework": "^1.0.0", + "aurelia-history-browser": "^1.0.0", + "aurelia-loader-webpack": "^1.0.0", + "aurelia-logging-console": "^1.0.0", + "aurelia-pal-browser": "^1.0.0", + "aurelia-polyfills": "^1.0.0", + "aurelia-route-recognizer": "^1.0.0", + "aurelia-router": "^1.0.2", + "aurelia-templating-binding": "^1.0.0", + "aurelia-templating-resources": "^1.0.0", + "aurelia-templating-router": "^1.0.0", + "bootstrap": "^3.3.7", + "isomorphic-fetch": "^2.2.1", + "jquery": "^2.2.1" + }, + "devDependencies": { + "@types/node": "^6.0.45", + "aspnet-webpack": "^1.0.11", + "aurelia-webpack-plugin": "^1.1.0", + "copy-webpack-plugin": "^3.0.1", + "css": "^2.2.1", + "css-loader": "^0.25.0", + "expose-loader": "^0.7.1", + "file-loader": "^0.9.0", + "html-loader": "^0.4.4", + "html-webpack-plugin": "^2.22.0", + "raw-loader": "^0.5.1", + "style-loader": "^0.13.1", + "to-string-loader": "^1.1.5", + "ts-loader": "^0.8.2", + "typescript": "^2.0.0", + "url-loader": "^0.5.7", + "webpack": "2.1.0-beta.22", + "webpack-hot-middleware": "^2.10.0" + } +} diff --git a/templates/AureliaSpa/project.json b/templates/AureliaSpa/project.json new file mode 100644 index 00000000..4fcf8fc0 --- /dev/null +++ b/templates/AureliaSpa/project.json @@ -0,0 +1,73 @@ +{ + "dependencies": { + "Microsoft.NETCore.App": { + "version": "1.0.1", + "type": "platform" + }, + "Microsoft.AspNetCore.SpaServices": "1.0.0-*", + "Microsoft.AspNetCore.Diagnostics": "1.0.0", + "Microsoft.AspNetCore.Mvc": "1.0.1", + "Microsoft.AspNetCore.Razor.Tools": { + "version": "1.0.0-preview2-final", + "type": "build" + }, + "Microsoft.AspNetCore.Server.IISIntegration": "1.0.0", + "Microsoft.AspNetCore.Server.Kestrel": "1.0.1", + "Microsoft.AspNetCore.StaticFiles": "1.0.0", + "Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0", + "Microsoft.Extensions.Configuration.Json": "1.0.0", + "Microsoft.Extensions.Configuration.CommandLine": "1.0.0", + "Microsoft.Extensions.Logging": "1.0.0", + "Microsoft.Extensions.Logging.Console": "1.0.0", + "Microsoft.Extensions.Logging.Debug": "1.0.0", + "Microsoft.Extensions.Options.ConfigurationExtensions": "1.0.0" + }, + + "tools": { + "Microsoft.AspNetCore.Razor.Tools": "1.0.0-preview2-final", + "Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.0.0-preview2-final", + "Microsoft.DotNet.Watcher.Tools": "1.0.0-preview2-final" + }, + + "frameworks": { + "netcoreapp1.0": { + "imports": [ + "dotnet5.6", + "portable-net45+win8" + ] + } + }, + + "buildOptions": { + "emitEntryPoint": true, + "preserveCompilationContext": true + }, + + "runtimeOptions": { + "configProperties": { + "System.GC.Server": true + } + }, + + "publishOptions": { + "include": [ + "appsettings.json", + "ClientApp/dist", + "Views", + "web.config", + "wwwroot" + ] + }, + + "scripts": { + "prepublish": [ + "npm install", + "node node_modules/webpack/bin/webpack.js --env.prod" + ], + "postpublish": "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" + }, + + "tooling": { + "defaultNamespace": "WebApplicationBasic" + } +} diff --git a/templates/AureliaSpa/tsconfig.json b/templates/AureliaSpa/tsconfig.json new file mode 100644 index 00000000..94b22fce --- /dev/null +++ b/templates/AureliaSpa/tsconfig.json @@ -0,0 +1,14 @@ +{ + "compilerOptions": { + "moduleResolution": "node", + "target": "es5", + "sourceMap": true, + "experimentalDecorators": true, + "emitDecoratorMetadata": true, + "skipDefaultLibCheck": true, + "lib": [ "es6", "dom" ], + "types": [ "node" ] + }, + "exclude": [ "bin", "node_modules" ], + "atom": { "rewriteTsconfig": false } +} diff --git a/templates/AureliaSpa/webpack.config.js b/templates/AureliaSpa/webpack.config.js new file mode 100644 index 00000000..ce2fd5f1 --- /dev/null +++ b/templates/AureliaSpa/webpack.config.js @@ -0,0 +1,64 @@ +var isDevBuild = process.argv.indexOf('--env.prod') < 0; +var path = require('path'); +var webpack = require('webpack'); +var AureliaWebpackPlugin = require('aurelia-webpack-plugin'); +var srcDir = path.resolve('./ClientApp'); +var rootDir = path.resolve(); +var outDir = path.resolve('./wwwroot/dist'); +var baseUrl = '/'; +var project = require('./package.json'); +var aureliaModules = Object.keys(project.dependencies).filter(dep => dep.startsWith('aurelia-')); + +// Configuration for client-side bundle suitable for running in browsers +var clientBundleConfig = { + resolve: { extensions: [ '.js', '.ts' ] }, + devtool: isDevBuild ? 'inline-source-map' : null, + entry: { + 'app': [], // <-- this array will be filled by the aurelia-webpack-plugin + 'aurelia-modules': aureliaModules + }, + output: { + path: outDir, + publicPath: '/dist', + filename: '[name]-bundle.js' + }, + module: { + loaders: [ + { + test: /\.ts$/, + include: /ClientApp/, + loader: 'ts', + query: {silent: true} + }, { + test: /\.html$/, + exclude: /index\.html$/, + loader: 'html-loader' + }, { + test: /\.css$/, + loaders: ['style-loader', 'css-loader'] + }, { + test: /\.(png|woff|woff2|eot|ttf|svg)$/, + loader: 'url-loader?limit=100000' + } + ] + }, + plugins: [ + new webpack.ProvidePlugin({ + $: 'jquery', // because 'bootstrap' by Twitter depends on this + jQuery: 'jquery' + }), + new AureliaWebpackPlugin({ + root: rootDir, + src: srcDir, + baseUrl: baseUrl + }), + new webpack.optimize.CommonsChunkPlugin({ + name: ['aurelia-modules'] + }), + ].concat(isDevBuild ? [] : [ + // Plugins that apply in production builds only + new webpack.optimize.UglifyJsPlugin() + ]) +}; + +module.exports = [clientBundleConfig]; diff --git a/templates/AureliaSpa/wwwroot/dist/_placeholder.txt b/templates/AureliaSpa/wwwroot/dist/_placeholder.txt new file mode 100644 index 00000000..b22cc154 --- /dev/null +++ b/templates/AureliaSpa/wwwroot/dist/_placeholder.txt @@ -0,0 +1,9 @@ +------------------------------------------------------------------ +Don't delete this file. Do include it in your source control repo. +------------------------------------------------------------------ + +This file exists as a workaround for https://github.com/dotnet/cli/issues/1396 +('dotnet publish' does not publish any directories that didn't exist or were +empty before the publish script started). + +Hopefully, this can be removed after the move to the new MSBuild. diff --git a/templates/AureliaSpa/wwwroot/favicon.ico b/templates/AureliaSpa/wwwroot/favicon.ico new file mode 100644 index 00000000..6884543f Binary files /dev/null and b/templates/AureliaSpa/wwwroot/favicon.ico differ diff --git a/templates/AureliaSpa/wwwroot/web.config b/templates/AureliaSpa/wwwroot/web.config new file mode 100644 index 00000000..e70a7778 --- /dev/null +++ b/templates/AureliaSpa/wwwroot/web.config @@ -0,0 +1,9 @@ + + + + + + + + +