在Google App Engine Java项目中忽略“node_modules”部署

3

Google App Engine 的 java 项目使用 node 模块 来执行 grunt 任务,用于构建前端。当我们运行 grunt built 后,它会生成要部署的 dist 文件夹。

我们有以下文件夹结构

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

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

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

但是它并不起作用。如何将它们从部署中排除?
1个回答

6

我使用没有“.”的资源文件,这对我有用。

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

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接