1.0.3 • Published 1 year ago

filter-magic-comments-loader v1.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

filter-magic-comments-loader for Webpack

用于过滤掉源码中的Magic Comments代码块的webpack-loader。

用法说明:

一、filter-magic-comments-loader的用处

目的

用于消除Magic Comments写法,避免出现恶意代码注入。

二、filter-magic-comments-loader的使用方法

2.1. 安装:

$ npm install --save-dev filter-magic-comments-loader

或者:

$ yarn add filter-magic-comments-loader --dev

2.2. 在webpack中添加filter-magic-comments-loader,

配置 你的webpack.config.js:

module.exports = {
  // ...
  module: {
    rules: [
      {
        test: /\.(js|ts|tsx|jsx|vue|css|html)$/,
        loader: 'filter-magic-comments-loader'
      }
    ]
  }
}