Giter VIP home page Giter VIP logo

zhangdiz / serverless-webpack-template Goto Github PK

View Code? Open in Web Editor NEW

This project forked from xlzy520/serverless-webpack-template

0.0 0.0 0.0 12 KB

利用webpack打包nodejs生成让serverless运行的资源。主要解决serverless需要上传node_modules导致占用空间过大的问题。成为我用来部署一些接口的利器模板。https://service-ijd4slqi-1253419200.gz.apigw.tencentcs.com/release/test

Home Page: https://service-ijd4slqi-1253419200.gz.apigw.tencentcs.com/release/test

Shell 0.03% JavaScript 99.97%

serverless-webpack-template's Introduction

serverless-webpack-express-starter

serverless-webpack-express-starter 模板是基于express-starter基础webpack打包功能的例子, 主要解决腾讯云serverless需要上传node_modules,但是占用空间过大的问题。

预览

点击

效果

70 M => 1.3 M

我的情况

在不打包的情况下,需要上传近70M,时间需要几分钟,经过打包之后,只占用1.3M,10秒钟就传上去了

快速开始

1. 安装

前提

# 安装 Serverless Framework
npm install -g serverless

项目内

# 安装 依赖
yarn

2. 开发

npm run start

3. 构建并部署

serverless.ymlsrc指向dist

npm run deploy

开发时遇到的坑

serverless+webpack解决node_modules空间大的问题

serverless-webpack-template's People

Contributors

xlzy520 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.