GithubHelp home page GithubHelp logo

Comments (6)

MitkoTschimev avatar MitkoTschimev commented on May 13, 2024 1

Ok figured out that the problem was just a wrong runtime version of node on azure :) so ncc is working amazingly! I will go for it

from nx-plugins.

ntziolis avatar ntziolis commented on May 13, 2024

First thing we need is a builder, becasue

  • azure functions require js files per function
  • all available builders create a single bundle

I have manually configured an nx app (based on @nrwl/node that contains an azure function project which builds fine. But without the ability to output multiple files when building we would only able to create a single function per project :)

I'm no expert in webpack but looking at:

It looks doable without major surgery. That said I never build an angular builder :)

After getting azure functions to build the next would be to tackle:

  • schematic for creating an azure function app
  • schematic for adding new function

After that one can look creating schematics for specific apps like nest.

from nx-plugins.

ntziolis avatar ntziolis commented on May 13, 2024

Update:

  • this following azure function webpack plugin looks promising. Its based on the previously azure-fucntion-pack package which is no longer maintained
    • it scans the entry directory for functions.json files and uses those to build the individual functions
  • we would also need to resolve tsconfig patsh properly, luckily there seems to be a very well supported webpack plugin for handling that

from nx-plugins.

MitkoTschimev avatar MitkoTschimev commented on May 13, 2024

Thanks a lot for all the input! I will try to check how I can fit it into this project! But let's start with small steps. So the first thing we should do is to be able to deploy a nestjs app with 1 function. then we can go ahead with splitting into multiple functions.

I know from Kamil they are working on a feature there where you can set separate functions via decorator on modules. Hope this lands soon to nestjs
https://github.com/nestjs/serverless-core

from nx-plugins.

MitkoTschimev avatar MitkoTschimev commented on May 13, 2024

Not easy to integrate it as easy as possible :(

2 options are there:

  1. you need to maintain a separate package.json with all the dependencies for the node / nest app
  2. Find a way to automatically align all required dependencies. Here I am trying at the moment this package: https://github.com/zeit/ncc but seems not to work. Trying still to make a workable solution with it.

from nx-plugins.

MitkoTschimev avatar MitkoTschimev commented on May 13, 2024

Implemented first version by #24

from nx-plugins.

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.