All Projects → Azure → Azure Functions Pack

Azure / Azure Functions Pack

Licence: mit
Easily package your Node.js Functions for Azure Functions

Programming Languages

javascript
184084 projects - #8 most used programming language
typescript
32286 projects

Projects that are alternatives of or similar to Azure Functions Pack

Es6 Webpack2 Starter
🚀 A template project for es6/7, webpack2/3, sass and postcss
Stars: ✭ 106 (-28.86%)
Mutual labels:  webpack, webpack2
Devopenclub Tech Webpack2
Webpack 2 视频教程课程源码
Stars: ✭ 148 (-0.67%)
Mutual labels:  webpack, webpack2
How To Setup Webpack 2
🔧 ⚙ Tutorial to setup webpack 2 from scratch.
Stars: ✭ 107 (-28.19%)
Mutual labels:  webpack, webpack2
Cookiecutter Webpack
Boilerplate for webpack 2, babel, react + redux + hmr, and karma. Can be inserted into existing django projects.
Stars: ✭ 87 (-41.61%)
Mutual labels:  webpack, webpack2
Ie Webpack Start
webpack2编译打包支持到低版本IE。坑有多少?水有多深?自行体会!
Stars: ✭ 130 (-12.75%)
Mutual labels:  webpack, webpack2
Webpack Conditional Loader
C conditionals directive for JavaScript
Stars: ✭ 93 (-37.58%)
Mutual labels:  webpack, webpack2
Webpack Typescript Starter
A simple Webpack 2 + TypeScript starter
Stars: ✭ 117 (-21.48%)
Mutual labels:  webpack, webpack2
Bootstrap Loader
Load Bootstrap styles and scripts in your Webpack bundle
Stars: ✭ 1,038 (+596.64%)
Mutual labels:  webpack, webpack2
React Redux Styled Hot Universal
react boilerplate used best practices and focus on performance
Stars: ✭ 147 (-1.34%)
Mutual labels:  webpack, webpack2
Everything Is A Plugin
Everything is a Plugin: Mastering webpack from the inside out. NgConf 2017
Stars: ✭ 123 (-17.45%)
Mutual labels:  webpack, webpack2
Webpack Seed
这是一个基于webpack的多页应用脚手架
Stars: ✭ 1,199 (+704.7%)
Mutual labels:  webpack, webpack2
Svg Sprite Loader
Webpack loader for creating SVG sprites.
Stars: ✭ 1,822 (+1122.82%)
Mutual labels:  webpack, webpack2
Serverless Plugin Webpack
Serverless Plugin Webpack
Stars: ✭ 72 (-51.68%)
Mutual labels:  webpack, webpack2
Webpack Core Usage
webpack2完整系列课程,欢迎阅读。同时欢迎移步我的react全家桶文章全集: https://github.com/liangklfangl/react-article-bucket
Stars: ✭ 94 (-36.91%)
Mutual labels:  webpack, webpack2
Generate Pages Tutorial
教你一步步从零构建 webpack 开发多页面环境
Stars: ✭ 63 (-57.72%)
Mutual labels:  webpack, webpack2
Serverless Webpack
Serverless plugin to bundle your lambdas with Webpack
Stars: ✭ 1,595 (+970.47%)
Mutual labels:  webpack, webpack2
Webpack Alioss Plugin
阿里 oss-webpack 自动上传插件
Stars: ✭ 35 (-76.51%)
Mutual labels:  webpack, webpack2
Dejajs Components
Angular components
Stars: ✭ 37 (-75.17%)
Mutual labels:  webpack, webpack2
Reactly Starter Kit
Deployable React + Webpack 2 starter kit
Stars: ✭ 122 (-18.12%)
Mutual labels:  webpack, webpack2
React Webpack Rails Tutorial
Example of integration of Rails, react, redux, using the react_on_rails gem, webpack, enabling the es7 and jsx transpilers, and node integration. And React Native! Live Demo:
Stars: ✭ 1,669 (+1020.13%)
Mutual labels:  webpack, webpack2

NOTE: This repository is no longer actively maintained

This tool has been replaced with Run From Package.

Azure Functions Pack was created to address significant cold start delays incurred by slow file read operations (read "The problem addressed" below). Azure Functions Pack reduces file read operation delays by condensing everything into one file. Run From Package addresses this same problem by keeping files as one payload and using a virtual file system that is much faster than the slower file system used by default. Run From Package works with function apps written in all languages and includes other benefits (such as atomicity, predictability, and faster deployment). You can read more about the benefits of Run From Package here, and you can read more about deploying with Run From Package here. If you are already using Zip deployment for Azure Functions, it's only a matter of adding WEBSITE_RUN_FROM_PACKAGE = 1 to your App Settings.

Azure Functions Pack

This is a tool to make it easy to package your Azure Functions Node.js Functions for optimal performance on Azure Functions.

The problem addressed

Whenever an Azure Function App is recreated on demand (a so called "cold start") the node'js module cache for each Function will be empty. The current Functions file system is sluggish in dealing with many small file accesses so there is a significant delay as node reads all the module files. Fortunately, node caches the modules in memory so subsequent accesses are fast.

The solution

A javascript module bundler (webpack) is used to place all the modules in a single file. The Function functions.json files are then modified so this bundle is used rather than the separate modules files. Magic!

How to run

In the Function App directory:

npm install -g azure-functions-pack
funcpack pack ./

You can then test locally using the CLI tool: func run <myfunc>

When uploading your files, you need to include the single .funcpack directory (in the Functions App root), but you don't need your node_modules directory.

Alternative when git deploying to Azure Functions

You can set the SCM_USE_FUNCPACK app setting to 1, and we'll install your packages and pack them whenever you git deploy. We recommend git deploying into a deployment slot and then swapping to prod to avoid downtime and resource contention. You can learn more about how to customize deployments on the kudu wiki.

API

Usage: funcpack [options] [command]


  Commands:

    unpack [options] <path>  Will remove all traces of packing tool at the specified path or the current directory if none is specified
    pack [options] <path>    Will pack the specified path or the current directory if none is specified

  Options:

    -h, --help           output usage information
    -u, --uglify         Uglify the project when webpacking
    -o, --output <path>  Path for output directory
    -c, --copyToOutput   Copy files to output directory

The copyToOutput option will copy all the important files for you to the output directory (aka .funcpack) and modify them there. This will let you publish from the output directory without having to touch your source code or remove your node_modules to save space. You can simply:

funcpack pack -c .
cd .funcpack
func azure functionapp publish <myapp>

unpack

Usage: unpack [options] <path>

  Will remove all traces of packing tool at the specified path or the current directory if none is specified

  Options:

    -h, --help           output usage information
    -o, --output <path>  Path for output directory

Note: the uglify feature only supports some small amount of es6, so I recommend that if you get errors either don't uglify or drop your code down to es5.

Uglify will minimize the sample project that's included from 27 MB to 9 MB.

pack

Usage: pack [options] <path>

  Will pack the specified path or the current directory if none is specified

  Options:

    -h, --help               output usage information
    -u, --uglify             Uglify the project when webpacking
    -o, --output <path>      Path for output directory
    -c, --copyToOutput       Copy files to output directory
    -e, --editConfig <path>  Customize webpack config by applying function in this file

The editConfig option will let you specify a js file containing a function to alter the webpack configuration.

// $root/webpack.config.js

module.exports = function(config, webpack) {
    config.plugins.push(new webpack.DefinePlugin({ "global.GENTLY": false }));
    return config;
}

funcpack.config.json

Pack will optionally take in a config file that will let you further customize the behavior. The config file must be in the directory you run the command from and named funcpack.config.json.

Here are all the supported options:

{
  "ignoredModules":["chai"]
}

License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].