Closed
Description
A pull request by @hai-x was merged and maintainers requested a documentation change.
See pull request: webpack/webpack#19058
What kind of change does this PR introduce?
perf only for development
mode
Fixes webpack/webpack#18458
Did you add tests for your changes?
Yes
Does this PR introduce a breaking change?
No
What needs to be documented once your changes are merged?
Add two options to https://webpack.js.org/configuration/module/#moduleparser
for json
parse
- Function that executes for a module source string and should return json-compatible data. Type((input: string) => any)
, for For example we can use toml parser
const toml = require("toml");
module.exports = [
{
module: {
rules: [
{
test: /\.toml$/,
type: "json",
parser: {
parse(input) {
return toml.parse(input);
}
}
}
]
}
}
];
exportsDepth
- The depth of json dependency flagged asexportInfo
. In dev mode - 1, in prod - Infinity, Typenumber
Metadata
Metadata
Assignees
Labels
No labels