dougmoscrop / serverless-plugin-include-dependencies

MIT License
184 stars 41 forks source link

Manually including packages #57

Open alexcroox opened 3 years ago

alexcroox commented 3 years ago

Is it possible to manually include deps? I have a Nuxt app which defines these in nuxt.config.js so I doubt this plugin could auto pick them up, which is fine I don't mind adding them manually, but I can't work out where and attempts have failed:

custom:
  includeDependencies:
    always:
      - 'api/**'
      - 'node_modules/nuxt-i18n' <-- this one

functions:
  render:
    [...]
    package:
      excludeDevDependencies: true
      exclude:
        - 'assets/**'
        - 'components/**'
        - 'layouts/**'
        - 'components/**'
        - 'middleware/**'
        - 'pages/**'
        - 'plugins/**'
        - '.github/**'
        - '.vscode/**'
      include:
        - '.nuxt/**'
        - 'server/edge.js'
        - 'nuxt.config.js'
        - 'node_modules/nuxt-i18n' <-- tried it here too
juandans01 commented 3 years ago

Exact same problem here

dougmoscrop commented 3 years ago

is it for sure in node_modules/nuxt-i18n? Did you try /**?

juandans01 commented 3 years ago

Hi, thanks for answering! so, i tried doing this

custom:
  includeDependencies:
    always:
      - 'node_modules/nuxt-i18n/**'

And there is a new error on deploy, maybe this is already a problem of nuxt-i18n? nevertheless it makes imposible using the library for me, any help help is appreciated

Error: Cannot find module '../middleware' from '<project>/node_modules/nuxt-i18n/src/templates'

Thanks