这里我对webpack使用过程中整理的一些心得。
-
entry
类型限制
type entry = string | string[] | {[name]: string}
应用起点入口路径
-
context
类型限制
type context = string
基础目录:绝对路径,默认使用当前目录
-
output
类型限制
interface output{ /* * filename * [name] 入口名称 * [id] chunk id * [hash] 每次构建生存的hash值 * [chunkhash] 使用基于每个 chunk 内容的 hash */ filename: string; // 输出文件名称, path: string; // 输出文件路径 }
-
module
-
noParse
类型限制
type noParse = RegExp | [RegExp] | Function;
让webpack不解析与noParse规则一致的文件;
-
rules
类型限制
type rules = Array;
每个规则可以分为三部分 - 条件(condition),结果(result)和嵌套规则(nested rule)。
-