cancel
Showing results for 
Search instead for 
Did you mean: 

how to include node_modules for the MTA build

lucky_li
Associate
Associate
1,133

By default, the node_modules will not be included into the content during the mbt build process. Whether there are some setting to force the mta to include the node_modules? As our project need to change some files after do the normal npm install'.

One trick I can figure out is that: we rename the "node_modules" to another name, and in the "start" script we build a softlink.

View Entire Topic
lucky_li
Associate
Associate
0 Kudos

I find a way that can work:

1: use the "zip" builder, so it will zip all content

- name: test-simple-express-oo

type: nodejs

build-parameters:

builder: zip

path: ./app

parameters:

buildpack: nodejs_buildpack

2: Put the "node_modules" in the second level ( if put it in the first level, then the node-buildpack will overwrite it)

3: the "start" script in package.json will start the file in the second level. As it has the "node_modules" in the dir, so it can start successfully.