Code Monkey home page Code Monkey logo

Comments (5)

justin-prather avatar justin-prather commented on May 20, 2024

I would also appreciate this, unless there is another way to ignore modules similar to webpacks ignorePlugin

from serverless-esbuild.

olup avatar olup commented on May 20, 2024

@justin-prather I might be mistaken, but isn't the exclude option used for exactly that ?

from serverless-esbuild.

justin-prather avatar justin-prather commented on May 20, 2024

@olup yes and no

From my understanding, you can exclude individual files using the serverless.yml exclude section. In my case though, what's happening is that the build is failing on an optional dependency of one of my project's dependencies. specifically pg-native. A package called slonik tries to use pg-native and if it is not available falls back to the pg module. the way i got around this with webpack was

plugins: [
    new IgnorePlugin({
      resourceRegExp: /^pg-native$/,
    }),
  ],

there is an equivalent for esbuild but it doesn't appear on the surface at least to be usable with serverless-esbuild

from serverless-esbuild.

floydspace avatar floydspace commented on May 20, 2024

Hey @thomaschaaf, unfortunately, I cannot reproduce the build error with slonik, or it is a runtime issue?
maybe it's possible to use exclude option in pair with inject. According to the inject doc you could make desired behavior for global vars. Would be good If you could make a minimal reproducible example to understand the issue. Anyway plugin support is a nice to have feature imo. thank you

from serverless-esbuild.

justin-prather avatar justin-prather commented on May 20, 2024

@floydspace looks like my issue was bubbling up from npm. Even though I'm not installing pg-native, it was still looking for the libpq dependency. Would still be nice to be able to just ignore that pattern and not have to install libpq

from serverless-esbuild.

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.