忽略“node_modules”从部署在Google App Engine Java项目中 [英] Ignore "node_modules" from deployment in Google App Engine Java Project

查看:147
本文介绍了忽略“node_modules”从部署在Google App Engine Java项目中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Google App Engine java项目使用节点模块来执行用于构建前端的grunt任务。运行 grunt built 后,它会给 dist 文件夹进行部署。


$
$ b

  myproject 
src /
war /
$ b

我们有以下文件夹结构$ b app /
dist /
node_modules /
Gruntfile.js
WEB-INF /

我们不想部署 node-modules 目录。我在 appengine-web.xml中添加以下内容

 < static -files> 
< exclude path =/ node_modules /*.*/>
< / static-files>

但它不起作用。如何将它们从部署中排除?

解决方案

使用没有'。'的资源文件为我工作。
$ b

 < resource-files> 
< exclude path =/ node_modules / **/>
< / resource-files>


Google App Engine java project uses node modules for grunt tasks which is used to build the front end. After we run grunt built, it gives the dist folder to be deployed.

We have following folder structure

myproject
   src/
   war/
      app/
      dist/
      node_modules/
      Gruntfile.js
      WEB-INF/

We do not want to deploy node-modules directory. I have add following in appengine-web.xml

<static-files>
    <exclude path="/node_modules/*.*" />
</static-files>

But it DOES NOT work. How to exclude them from deployment?

解决方案

Using resource-files without '.' worked for me.

    <resource-files>
        <exclude path="/node_modules/**" />
    </resource-files>

这篇关于忽略“node_modules”从部署在Google App Engine Java项目中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆