nfour / serverless-build-plugin

A Node.js focused build plugin for serverless.
MIT License
41 stars 9 forks source link

include pattern not recoginized on Windows #29

Open abhishekbiyala opened 7 years ago

abhishekbiyala commented 7 years ago

Hi,

I am trying use include pattern as follows. It works fine when running serverless from Linux and Mac but not on Windows. serverless-build-plugin does not add [SOURCE] on Windows due to this.

functions:
  test:
    include:
      - dist/**

Thanks, Abhishek

nfour commented 7 years ago

Need more information

I've scanned over the obvious locations in the codebase to see if path was not normalizing filePaths but cannot see anything standing out.

sushant-pradhan commented 7 years ago

Hello, I encountered the same issue in windows. Here is the version info: i) serverless-build-plugin@1.1.15 ii) serverless@1.9.0 iii) No error message but it starts packaging [MODULE]. Ideally it should package [SOURCE] followed by [MODULE] iv) The zip artifact has only node_modules folder and no dist folder

nfour commented 7 years ago

@an-sush Can you please show us your serverless.build.yml?

sushant-pradhan commented 7 years ago

I am using serverless.yml with following sections related to build-plugin:

custom:
  build:
    method: bundle
    sourceMaps: true
    include:
      - 'dist/**'
plugins:
  - serverless-build-plugin
jawadst commented 7 years ago

I am seeing the same issue. Here is my serverless.build.yml:

method: bundle

babel: true
uglify: false

include:
  - src/

functions:
  scrape:
    include:
      - "src/scrape/**"

Nothing gets built when I run it on Windows (I get an empty ZIP file) whereas it works fine in a Docker container running Linux.

nfour commented 7 years ago

Right, will try this on windows when I get a chance. Bear with me guys :+1: