Eclipse下忽略掉node_modules目录相关配置

1.背景

  Eclipse项目中的静态资源采用webpack来打包,在项目中的webapp目录下会生成node_modules目录,里面包含node相关模块。因为资源文件较多,会形成Eclipse编译缓慢,另外这些文件不须要发不到运行服务器上,且不须要作版本控制。node

2.相关配置

2.1 编译Eclipse项目时忽略掉node_modules目录

  选中项目右键-properties,以下图所示webpack

这里写图片描述

2.2 SVN版本管理时忽略掉node_modules目录

  当使用Eclipse中的SVN来来就行版本控制时,选择node_modules目录后,发现添加至svn:ignore为灰色,不可用,没法忽略相关文件。能够经过以下配置来解决该问题。web

这里写图片描述

2.3 项目打包发布时去掉node_modules目录

  在项目的maven pom.xml中build下的配置以下apache

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-war-plugin</artifactId>
    <version>2.6</version>
    <configuration>
        <packagingExcludes>
            node_modules/**
        </packagingExcludes>
    </configuration>
</plugin>
相关文章
相关标签/搜索