Code Monkey home page Code Monkey logo

Comments (4)

wan2land avatar wan2land commented on September 6, 2024 2

One more,

serverless.yml

package:
  exclude:
    - assets/**
    - components/**
    - pages/**
    - node_modules/**/*.ts
    - node_modules/**/*.ts.map
    - node_modules/**/*.js.map
    - node_modules/**/*.css.map

from serverless-nuxt.

wan2land avatar wan2land commented on September 6, 2024

in my case,

.serverless directory

cloudformation-template-create-stack.json
cloudformation-template-update-stack.json (or not)
serverless-state.json
project-name.zip

.serverless/project-name.zip directory

.next/**
node_modules/**

...(nuxt root directories like below)...
assets/**
modules/**
pages/**
plugins/**

package.json
package-lock.json
nuxt.config.js

handler.js (lambda entry file)

from serverless-nuxt.

wan2land avatar wan2land commented on September 6, 2024

If it exceeds 110MB, it is most likely a font or image.

All static files created after webpack build in the plugin are uploaded to s3.

  1. When installing font or image related packages by npm, run it with the `--dev` option.
  2. If you use image or font files under /static, please move them all under /assets. And when using in vue, please use the path using webpack.

Example in CSS

.something {
  background-image: url(~assets/images/something.png);
}

Example in Vue

<template>
  <!-- (X) -->
  <!-- <img src="/static/something.png" /> -->
  <!-- (O) -->
  <img :src="require('~/assets/images/something.png')" />
</template>

from serverless-nuxt.

alexcroox avatar alexcroox commented on September 6, 2024

@hmaesta the issue with many of these Nuxt lambda helpers is they don't seem to be tested with real world applications of a reasonable size. If you add a bunch of deps that are huge but tree-shaken small during a nuxt build, you still can't upload your package to Lambda because it contains the raw non tree-shaken node_modules versions which quickly hit the 50MB Lambda@Edge limit on any reasonably complex project.

from serverless-nuxt.

Related Issues (20)

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.