Git Product home page Git Product logo

web-client-assets-bundling's Introduction

Web-Client-Assets-Bundling

Bundling client-assets for a web-application. Using gulp and rollup.

This is a solution for showing one way to handle client-assets for a web-application. That is:

  • One bundled css-file (unminified/minified)
  • One svg-sprite
  • One bundled javascript-file (unminified/minified)

It is handled with npm, gulp, rollup and the "Task Runner Explorer".

The solution is a razor-pages-application, with some diagnostics pages. But that is not important. The important files and folders are:

  • wwwroot
  • Scripts
  • Style
  • gulpfile.js
  • package.json
  • tsconfig.json

Initially install all npm-packages by using any of the following:

  • the install-task (package.json) in "Task Runner Explorer"
  • right-clicking the package.json -> Restore Packages

Make changes to any of the following:

  • Scripts/Site.ts
  • Style/Icons (add an svg)
  • Style/Images (add an image)
  • Style/Site.scss

then run the "default" task in the "Task Runner Explorer" and you get the result under the wwwroot-folder.

1 GitHub workflows

This repository contains workflows:

The workflows uses secrets.

1.1 Secrets

1.1.1 AZURE_CREDENTIALS

You need an Azure service principal to setup the credentials. If you not already have one, that you can use, you need to create one. A service principal ends up as an "App registration" in your Azure Active Directory. You can run commands with the Cloud Shell [>_] at https://portal.azure.com/.

az ad sp create-for-rbac --name "{sp-name}" --role "Contributor" --sdk-auth

Response:

{
  "clientId": "{guid}",
  "clientSecret": "{secret}",
  "subscriptionId": "{guid}",
  "tenantId": "{guid}",
  "activeDirectoryEndpointUrl": "https://login.microsoftonline.com",
  "resourceManagerEndpointUrl": "https://management.azure.com/",
  "activeDirectoryGraphResourceId": "https://graph.windows.net/",
  "sqlManagementEndpointUrl": "https://management.core.windows.net:8443/",
  "galleryEndpointUrl": "https://gallery.azure.com/",
  "managementEndpointUrl": "https://management.core.windows.net/"
}

The first four are the ones you want. The value to set in your secret is:

{"clientId":"{guid}","clientSecret":"{secret}","subscriptionId":"{guid}","tenantId":"{guid}"}

Links:

1.1.2 AZURE_RESOURCE_GROUP_LOCATION

The location for the resource-group, eg. westeurope. List of available locations:

1.1.3 AZURE_RESOURCE_GROUP_NAME

The name of the resource-group.

1.1.4 DOCKER_PASSWORD

Your https://hub.docker.com/ access token.

1.1.5 DOCKER_USERNAME

Your https://hub.docker.com/ username.

web-client-assets-bundling's People

Contributors

hanskindberg avatar

Watchers

 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.