Giter Site home page Giter Site logo

gulp-find-unused's Introduction

检测文件夹中的资源有没有被项目使用到,没被用到的会被标记为冗余文件。

仅支持【非webpack】打包项目 ,webpack打包的项目,请使用tree-shaking

Getting Started

npm install gulp-find-unused --save-dev

Usage

let fu = require('gulp-find-unused');
gulp.task("fu", () => {
    return gulp.src("build_artifacts")
        .pipe(fu({
            ignoreList: ['ry.json', 'main.html'],
            createFile: true,
            debug: true,
            fileDir: "build"
        }))
        .pipe(gulp.dest("find-unused"))
})

gulp.src导入的路径为用gulp构建之后的工程目录

Options

ignoreList

Type:Array Default value:[]

一个忽略检测的文件的列表

createFile

Type:Boolean Default value:false

是否把检测结果输出到一个独立的文件中

fileDir

createFiletrue的情况下,这个值才有用

Type:String Default value:跟gulp.src的参数保持一致。

要输出的文件的路径

debug

Type:Boolean Default value:false

是否打印日志信息

ToDoList

  • ignoreList支持路径和多层路径,目前仅支持文件名称

Release History

日期 版本 说明
2017-11-23 v0.3.0 修复生成的JSON文件被当做项目文件进行扫描而导致的冗余文件结果错误的BUG
2017-11-23 v0.2.0 支持打印冗余文件总大小
2017-11-22 v0.1.0 初次提交

gulp-find-unused's People

Contributors

ireeoome avatar ireeoo avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.