Giter VIP home page Giter VIP logo

serverless-webpack-plugin's People

Contributors

ac360 avatar alastaircoote avatar alua-kinzhebayeva avatar arabold avatar asprouse avatar bugeats avatar joostfarla avatar kpotehin avatar minibikini avatar sanjosolutions avatar staceymoore avatar swarajgiri avatar thewillhuang avatar tribou avatar whoaa512 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

serverless-webpack-plugin's Issues

Can't deploy multiple functions at once

After trying to run sls function deploy --all I see the following.

If I try to deploy each function individually it works, but any more than 1 at a time fails with only one of the zips being created properly.

Only happens with webpack plugin.

On version 0.5.5 of serverless using node 5.11.0

Let me know if you need more details

Serverless: ------------------------
Serverless: Failed to deploy the following functions in "dev" to the following regions:
Serverless: us-west-2 ------------------------
Serverless:   create: Uploaded file must be a non-empty zip
Serverless:   read: Uploaded file must be a non-empty zip
Serverless:   archive: Uploaded file must be a non-empty zip
/usr/local/lib/node_modules/serverless/node_modules/bluebird/js/release/async.js:61
        fn = function () { throw arg; };
                           ^

ServerlessError: Function Deployment Failed
  at new ServerlessError (/usr/local/lib/node_modules/serverless/lib/Error.js:17:11)
  at FunctionDeploy.<anonymous> (/usr/local/lib/node_modules/serverless/lib/actions/FunctionDeploy.js:126:19)
  at next (/usr/local/lib/node_modules/serverless/node_modules/rimraf/rimraf.js:74:7)
  at FSReqWrap.CB [as oncomplete] (/usr/local/lib/node_modules/serverless/node_modules/rimraf/rimraf.js:110:9)
From previous event:
  at FunctionDeploy.functionDeploy (/usr/local/lib/node_modules/serverless/lib/actions/FunctionDeploy.js:105:10)
From previous event:
  at /usr/local/lib/node_modules/serverless/lib/Serverless.js:186:31
  at Array.reduce (native)
  at /usr/local/lib/node_modules/serverless/lib/Serverless.js:185:32
From previous event:
  at Serverless._execute (/usr/local/lib/node_modules/serverless/lib/Serverless.js:183:12)
  at Serverless.actions.(anonymous function) (/usr/local/lib/node_modules/serverless/lib/Serverless.js:429:20)
  at Serverless.command (/usr/local/lib/node_modules/serverless/lib/Serverless.js:398:38)
  at /usr/local/lib/node_modules/serverless/bin/serverless:19:16
  at tryOnImmediate (timers.js:534:15)
  at processImmediate [as _immediateCallback] (timers.js:514:5)
From previous event:
  at Object.<anonymous> (/usr/local/lib/node_modules/serverless/bin/serverless:18:4)
  at Module._compile (module.js:413:34)
  at Object.Module._extensions..js (module.js:422:10)
  at Module.load (module.js:357:32)
  at Function.Module._load (module.js:314:12)
  at Function.Module.runMain (module.js:447:10)
  at startup (node.js:148:18)
  at node.js:405:3

Using `serverless function run`

Hey there! Gz for the update for v0.5.

So I'm in the process of setting it up. First of, I think that the readme should specify that in the s-function.json one should have "runtime": "nodejs",.

Second I tried serverless function run myfunc and I of course get an error because the js code is not going through babel (nor webpack). How could we solve this?

Thanks!

node-mysql2 works with uglifyjs

    new webpack.optimize.UglifyJsPlugin({
      compress: {
        unused: true,
        dead_code: true,
        warnings: false,
        drop_debugger: true,
      },
      comments: false,
      mangle: false,
    }),

mangle:false

the above setting will allow node-mysql2 to work, not really an issue per say but just a discovery for modules that have problems,

adding entry to webpack.config.js

@sanjo this pull request #21

added support for loading modules before the handler. However, when I do as the docs suggest I get this error:

Serverless:   my-function: Path must be a string. Received [ 'babel-polyfill' ]

...


/usr/local/lib/node_modules/serverless/node_modules/bluebird/js/release/async.js:61
        fn = function () { throw arg; };
                           ^
ServerlessError: Function Deployment Failed
    at new ServerlessError (/usr/local/lib/node_modules/serverless/lib/Error.js:17:11)
    at FunctionDeploy.<anonymous> (/usr/local/lib/node_modules/serverless/lib/actions/FunctionDeploy.js:126:19)
    at next (/usr/local/lib/node_modules/serverless/node_modules/rimraf/rimraf.js:74:7)
    at FSReqWrap.CB [as oncomplete] (/usr/local/lib/node_modules/serverless/node_modules/rimraf/rimraf.js:110:9)
From previous event:
    at FunctionDeploy.functionDeploy (/usr/local/lib/node_modules/serverless/lib/actions/FunctionDeploy.js:105:10)
From previous event:
    at /usr/local/lib/node_modules/serverless/lib/Serverless.js:211:25
    at Array.reduce (native)
    at Serverless._execute (/usr/local/lib/node_modules/serverless/lib/Serverless.js:210:26)
    at Object.actions.(anonymous function) [as functionDeplo

this is my webpack.config.js:

var webpack = require("webpack");

module.exports = {
  target: "node",
  entry: ["babel-polyfill"],
  externals: [
    "aws-sdk"
  ],
  resolve: {
    extensions: ["", ".js"]
  },
  devtool: "source-map",
  plugins: [
    new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/),
    new webpack.optimize.DedupePlugin(),
    new webpack.optimize.OccurenceOrderPlugin(),
    new webpack.optimize.UglifyJsPlugin({
      compress: {
        unused: true,
        dead_code: true,
        warnings: false,
        drop_debugger: true
      }
    })
  ],
  module: {
    loaders: [
      {
        test: /\.jsx?$/,
        loader: "babel",
        exclude: /node_modules/,
        query: {
          presets: ["es2015", "node6", "stage-0"]
        }
      }
    ]
  }
};

Path issue deploying from project root

Hi there,

Deploying from project root using sls dash deploy does not prepend each component's folder to the entry point path (I only have one component called api). Running the same command from within the component's folder works just fine.

Is there anything I'm missing when configuring the plugin? My entry in s-component.json in this case is:

"custom": {
    "webpack": {
      "configPath": "api/webpack.config.js"
    }
  }

I went through the code in bundle.js but couldn't figure out where the issue might be. I'm not very familiar with Serverless plugins and can't figure out where the component's name or folder path would come from.

Breaking with serverless v0.5?

Hello there! serverless 0.5 isn't working here:

/usr/local/lib/node_modules/serverless/node_modules/bluebird/js/release/async.js:49
        fn = function () { throw arg; };
                           ^

TypeError: Class extends value #<Serverless> is not a function or null
    at getPlugin (/my-serverless-project/node_modules/serverless-webpack-plugin/index.js:6:35)
    at Serverless._loadPlugins (/usr/local/lib/node_modules/serverless/lib/Serverless.js:286:25)
    at Serverless.loadProjectPlugins (/usr/local/lib/node_modules/serverless/lib/Serverless.js:240:10)
    at /usr/local/lib/node_modules/serverless/lib/Serverless.js:77:41
From previous event:
    at Serverless.init (/usr/local/lib/node_modules/serverless/lib/Serverless.js:73:25)
    at Object.<anonymous> (/usr/local/lib/node_modules/serverless/bin/serverless:17:12)
    at Module._compile (module.js:413:34)
    at Object.Module._extensions..js (module.js:422:10)
    at Module.load (module.js:357:32)
    at Function.Module._load (module.js:314:12)
    at Function.Module.runMain (module.js:447:10)
    at startup (node.js:142:18)
    at node.js:939:3

any clue?

Thanks!

node-mysql2 "undefined is not a function", "errorType": "TypeError"

hello all, i've been trying to get node-msql2 to work with lambda and i keep getting the above error, turns out, it was caused by webpack's uglifyjs plugin, disable it, and your bundle size will increase by 100%, but this error goes away. In any case, because this is not being transferred every time your client views your page, a big bundle size really doesn't matter that much.

just wanted to point that out, so you don't waste hours on it for no reason ๐Ÿ‘

Error: Cannot find module '<<root>>'] code: 'MODULE_NOT_FOUND'

I am getting this error after following the instruction from README.md.

Serverless: Deploying the specified functions in "demo" to the following regions: us-east-1  
Serverless: | { [Error: Cannot find module '<<root_folder>>'] code: 'MODULE_NOT_FOUND' }
Serverless: ------------------------  
Serverless: Successfully deployed the following functions in "demo" to the following regions:   
Serverless: us-east-1 ------------------------  
....
metric filters created

My configuration in s-function.json is:

"custom": {
    "excludePatterns": [],
    "webpack": {
      "configPath": "./"
    }
  }

Not such what I am doing wrong.

Version 0.4.4. is broken

We found that in the version 0.4.4 imports and requires are not resolving properly on lambda deployment.

It works fine if version is reverted to 0.4.3

Error we get is:

Module not found: Error: Cannot resolve 'file' or 'directory' ../../lib/auth/login in /home/$PATH/_meta/_tmp/login@1468978270231
 @ ./_meta/_tmp/login@1468978270231/handler.js 12:13-44  

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.