How to exclude "node_modules" folder when deploy?

Answered

Say I got a client code folder like this:

WebRoot

  -- css

  -- core(or dist)

  -- img

  -- node_modules

  -- ...

 

currently, I config Web Resource Directories like this:

 

I do this only because I want exclude the "node_modules" folder when deploy. So I wonder is there a convenient way to only config the "WebRoot" folder as Web Resorce Directory, and exclude the "node_modules" folder.

Best Regards.

0
9 comments

Exclude directory from web resource root you can only via marking it as Excluded directory.

1
Avatar
Permanently deleted user

Thanks a lot! :)

0

I've turned on:

- external changes
- always upload files

What can cause an node_modules upload of excluded directorys?

Currently with `node_modules` I've currently this issue. It is excluded, but getting completly deployed on every little change.
On another workstation the exclusion works without any problems. 

0

Try adding `node_modules` to Exclude items by name: in Settings | Build, Execution, Deployment | Deployment | Options

1

I have excluded node_modules both on local machine and remote server but it still keeps on uploading them. As you can see at the bottom, Intelij says node_modules is located out of project, which is wrong. I think it's ignoring this exclusion by mistake. Any solution?

0

Elena Pogorelova

Do you mean something like this? ( node_modules/*.* )

0

Elena Pogorelova:

On the "exclude path"-list (in the first screenshot of S6kaghas I put always my external node_modules paths. (even if they still not exists).

But do I understand it correct, that when we just put this into the "Exclude items by name"-field, like S6kaghas did, this would already be enough and we can save us the extra afford to exclude them externally?

0

Dear Elena Pogorelova
I tested both `node_modules` and `node_modules/*.*`, but It stills upload the `node_modules` to the remote server.

1

Please sign in to leave a comment.