Code Monkey home page Code Monkey logo

fecs-loader's Introduction

fecs-loader Build Status

fecs loader (for webpack) —— webpack中的fecs检查工具

Usage

安装fecs-loader

$ npm install fecs-loader

如果less/css/js文件都check,可直接在原有webpack.config.js配置中的module.loaders的基础上加多一项

{
    test: /\.(less|css|js)$/,
    loader: 'fecs-loader'
}

或者只针对某一类文件check,可在原有的loader配置中添加loader,如:

{
    test: /\.js$/,
    loader: 'fecs-loader'
},
{
    test: /\.css$/,
    loader: 'style-loader!css-loader!fecs-loader'
},
{
    test: /\.less$/,
    loader: 'style-loader!css-loader!less-loader!fecs-loader'
}

因为webpack的loader调用的顺序是从后往前的,所以为了fecs-loader能check最原始的代码,请将fecs-loader放置在数组or叹号相连的loader中的最后

Options

可以直接将参数加在loader后,形如fecs-loader?key=value,也可以将参数罗列在webpack.config.js全局配置中形如:

module: {
	fecs: {
		key: value
	}
}

建议将参数写在全局配置中

faileOnError(default: false)

是否在fecs检测到模块内容有error时使模块编译失败,若failOnError为true则模块内容遇到fecs error时模块内容将不出现在编译结果中

faileOnWarning(default: false)

是否在fecs检测到模块内容有warning时使模块编译失败,若failOnWarning为true则模块内容遇到fecs warning时模块内容将不出现在编译结果中

exclude(default: '')

指定要忽略的glob文件模式,如./index.js``````./index.js,./src/config/*.js,文件模式若有多条,模式之间使用逗号,分隔

Example

module.exports = {
    module: {
        loaders: [
            {test: /\.(less|css|js|vue)$/, loader: 'fecs-loader'}
        ]
    },
    fecs: {
        failOnError: true,
        failOnWarning: true,
        exclude: './index.js,./index2.js'
    }
};

fecs-loader's People

Contributors

zhangzhiqiang37 avatar chriswong avatar

Watchers

James Cloos avatar Dafrok 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.