<NME> webpack.config.js
<BEF> const toml = require("toml");
const json5 = require("json5");
const yaml = require("yamljs");

module.exports = {
	module: {
		rules: [
			{
				test: /\.toml$/,
				type: "json",
				parser: {
					parse: toml.parse
				}
			},
				}
			},
			{
				test: /\.json$/,
				type: "json",
				parser: {
					parse(input) {
			{
				test: /\.yaml$/,
				type: "json",
				parser: {
					parse: yaml.parse
				}
			}
		]
	}
};

<MSG> fix custom-json-modules example

<DFF> @@ -15,7 +15,7 @@ module.exports = {
 				}
 			},
 			{
-				test: /\.json$/,
+				test: /\.json5$/,
 				type: "json",
 				parser: {
 					parse(input) {

{'commit': 'diff --git a/examples/custom-json-modules/README.md b/examples/custom-json-modules/README.md\nindex f6a83b537..8bcb0a4ed 100644\n--- a/examples/custom-json-modules/README.md\n+++ b/examples/custom-json-modules/README.md\n@@ -1,6 +1,6 @@\n This very simple example shows usage of a custom parser for json-modules.\n \n-Toml files can be imported like other modules without toml-loader.\n+Toml, yaml and json5 files can be imported like other modules without toml-loader.\n \n # data.toml\n \n@@ -17,7 +17,7 @@ dob = 1979-05-27T07:32:00Z\n # data.yaml\n \n ```yaml\n-title: TOML Example\n+title: YAML Example\n owner:\n   name: Tom Preston-Werner\n   organization: GitHub\n@@ -32,7 +32,7 @@ owner:\n ```json5\n {\n   // comment\n-  title: "TOML Example",\n+  title: "JSON5 Example",\n   owner: {\n     name: "Tom Preston-Werner",\n     organization: "GitHub",\n@@ -48,7 +48,7 @@ Likes tater tots and beer.",\n ```javascript\n import toml from "./data.toml";\n import yaml from "./data.yaml";\n-import json from "./data.json";\n+import json from "./data.json5";\n \n document.querySelector(\'#app\').innerHTML = [toml, yaml, json].map(data => `\n   <h1>${data.title}</h1>\n@@ -63,8 +63,8 @@ document.querySelector(\'#app\').innerHTML = [toml, yaml, json].map(data => `\n \n ```javascript\n const toml = require("toml");\n-const json5 = require(\'json5\');\n-const yaml = require(\'yamljs\');\n+const json5 = require("json5");\n+const yaml = require("yamljs");\n \n module.exports = {\n \tmodule: {\n@@ -79,7 +79,7 @@ module.exports = {\n \t\t\t\t}\n \t\t\t},\n \t\t\t{\n-\t\t\t\ttest: /\\.json$/,\n+\t\t\t\ttest: /\\.json5$/,\n \t\t\t\ttype: "json",\n \t\t\t\tparser: {\n \t\t\t\t\tparse(input) {\n@@ -118,12 +118,12 @@ module.exports = {\n __webpack_require__.r(__webpack_exports__);\n /* harmony import */ var _data_toml__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./data.toml */ 1);\n /* harmony import */ var _data_yaml__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./data.yaml */ 2);\n-/* harmony import */ var _data_json__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./data.json */ 3);\n+/* harmony import */ var _data_json5__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./data.json5 */ 3);\n \n \n \n \n-document.querySelector(\'#app\').innerHTML = [_data_toml__WEBPACK_IMPORTED_MODULE_0__/* .default */ , _data_yaml__WEBPACK_IMPORTED_MODULE_1__/* .default */ , _data_json__WEBPACK_IMPORTED_MODULE_2__/* .default */ ].map(data => `\n+document.querySelector(\'#app\').innerHTML = [_data_toml__WEBPACK_IMPORTED_MODULE_0__/* .default */ , _data_yaml__WEBPACK_IMPORTED_MODULE_1__/* .default */ , _data_json5__WEBPACK_IMPORTED_MODULE_2__/* .default */ ].map(data => `\n   <h1>${data.title}</h1>\n   <div>${data.owner.name}</div>\n   <div>${data.owner.organization}</div>\n@@ -188,13 +188,13 @@ module.exports = JSON.parse("{\\"title\\":\\"TOML Example\\",\\"owner\\":{\\"name\\":\\"T\n /*! runtime requirements: module */\n /***/ ((module) => {\n \n-module.exports = JSON.parse("{\\"title\\":\\"TOML Example\\",\\"owner\\":{\\"name\\":\\"Tom Preston-Werner\\",\\"organization\\":\\"GitHub\\",\\"bio\\":\\"GitHub Cofounder & CEO\\\\nLikes tater tots and beer.\\",\\"dob\\":\\"1979-05-27T07:32:00.000Z\\"}}");\n+module.exports = JSON.parse("{\\"title\\":\\"YAML Example\\",\\"owner\\":{\\"name\\":\\"Tom Preston-Werner\\",\\"organization\\":\\"GitHub\\",\\"bio\\":\\"GitHub Cofounder & CEO\\\\nLikes tater tots and beer.\\",\\"dob\\":\\"1979-05-27T07:32:00.000Z\\"}}");\n \n /***/ }),\n /* 3 */\n-/*!*******************!*\\\n-  !*** ./data.json ***!\n-  \\*******************/\n+/*!********************!*\\\n+  !*** ./data.json5 ***!\n+  \\********************/\n /*! export default [provided] [no usage info] [no name, virtual] */\n /*!   export owner [provided] [no usage info] [missing usage info prevents renaming] */\n /*!     export bio [provided] [no usage info] [missing usage info prevents renaming] */\n@@ -215,7 +215,7 @@ module.exports = JSON.parse("{\\"title\\":\\"TOML Example\\",\\"owner\\":{\\"name\\":\\"T\n /*! runtime requirements: module */\n /***/ ((module) => {\n \n-module.exports = JSON.parse("{\\"title\\":\\"TOML Example\\",\\"owner\\":{\\"name\\":\\"Tom Preston-Werner\\",\\"organization\\":\\"GitHub\\",\\"bio\\":\\"GitHub Cofounder & CEO\\\\nLikes tater tots and beer.\\",\\"dob\\":\\"1979-05-27T07:32:00.000Z\\"}}");\n+module.exports = JSON.parse("{\\"title\\":\\"JSON5 Example\\",\\"owner\\":{\\"name\\":\\"Tom Preston-Werner\\",\\"organization\\":\\"GitHub\\",\\"bio\\":\\"GitHub Cofounder & CEO\\\\nLikes tater tots and beer.\\",\\"dob\\":\\"1979-05-27T07:32:00.000Z\\"}}");\n \n /***/ })\n /******/ \t]);\n@@ -282,19 +282,19 @@ module.exports = JSON.parse("{\\"title\\":\\"TOML Example\\",\\"owner\\":{\\"name\\":\\"T\n ## webpack output\n \n ```\n-Hash: \x1b[1m8f69e0ad2f96aaaa29ec\x1b[39m\x1b[22m\n+Hash: \x1b[1mf9cc6e468bda1ef6f9fb\x1b[39m\x1b[22m\n Version: webpack \x1b[1m5.0.0-beta.7\x1b[39m\x1b[22m\n-Time: \x1b[1m123\x1b[39m\x1b[22mms\n+Time: \x1b[1m204\x1b[39m\x1b[22mms\n     \x1b[1mAsset\x1b[39m\x1b[22m      \x1b[1mSize\x1b[39m\x1b[22m\n-\x1b[1m\x1b[32moutput.js\x1b[39m\x1b[22m  8.17 KiB  \x1b[1m\x1b[32m[emitted]\x1b[39m\x1b[22m  [name: main]\n+\x1b[1m\x1b[32moutput.js\x1b[39m\x1b[22m  8.18 KiB  \x1b[1m\x1b[32m[emitted]\x1b[39m\x1b[22m  [name: main]\n Entrypoint \x1b[1mmain\x1b[39m\x1b[22m = \x1b[1m\x1b[32moutput.js\x1b[39m\x1b[22m\n-chunk \x1b[1m\x1b[32moutput.js\x1b[39m\x1b[22m (main) 917 bytes (javascript) 274 bytes (runtime) \x1b[1m\x1b[33m[entry]\x1b[39m\x1b[22m \x1b[1m\x1b[32m[rendered]\x1b[39m\x1b[22m\n+chunk \x1b[1m\x1b[32moutput.js\x1b[39m\x1b[22m (main) 919 bytes (javascript) 274 bytes (runtime) \x1b[1m\x1b[33m[entry]\x1b[39m\x1b[22m \x1b[1m\x1b[32m[rendered]\x1b[39m\x1b[22m\n     > ./example.js \x1b[1m\x1b[39m\x1b[22m main\n- \x1b[1m./data.json\x1b[39m\x1b[22m 188 bytes \x1b[1m\x1b[32m[built]\x1b[39m\x1b[22m\n+ \x1b[1m./data.json5\x1b[39m\x1b[22m 189 bytes \x1b[1m\x1b[32m[built]\x1b[39m\x1b[22m\n      \x1b[1m\x1b[36m[exports: default, owner, title]\x1b[39m\x1b[22m\n      \x1b[1m\x1b[36m[used exports unknown]\x1b[39m\x1b[22m\n-     harmony side effect evaluation \x1b[1m\x1b[36m./data.json\x1b[39m\x1b[22m \x1b[1m\x1b[35m./example.js\x1b[39m\x1b[22m 3:0-31 \x1b[1m\x1b[36m\x1b[39m\x1b[22m\n-     harmony import specifier \x1b[1m\x1b[36m./data.json\x1b[39m\x1b[22m \x1b[1m\x1b[35m./example.js\x1b[39m\x1b[22m 5:56-60 \x1b[1m\x1b[36m\x1b[39m\x1b[22m\n+     harmony side effect evaluation \x1b[1m\x1b[36m./data.json5\x1b[39m\x1b[22m \x1b[1m\x1b[35m./example.js\x1b[39m\x1b[22m 3:0-32 \x1b[1m\x1b[36m\x1b[39m\x1b[22m\n+     harmony import specifier \x1b[1m\x1b[36m./data.json5\x1b[39m\x1b[22m \x1b[1m\x1b[35m./example.js\x1b[39m\x1b[22m 5:56-60 \x1b[1m\x1b[36m\x1b[39m\x1b[22m\n  \x1b[1m./data.toml\x1b[39m\x1b[22m 188 bytes \x1b[1m\x1b[32m[built]\x1b[39m\x1b[22m\n      \x1b[1m\x1b[36m[exports: default, owner, title]\x1b[39m\x1b[22m\n      \x1b[1m\x1b[36m[used exports unknown]\x1b[39m\x1b[22m\n@@ -305,7 +305,7 @@ chunk \x1b[1m\x1b[32moutput.js\x1b[39m\x1b[22m (main) 917 bytes (javascript) 274 bytes (runt\n      \x1b[1m\x1b[36m[used exports unknown]\x1b[39m\x1b[22m\n      harmony side effect evaluation \x1b[1m\x1b[36m./data.yaml\x1b[39m\x1b[22m \x1b[1m\x1b[35m./example.js\x1b[39m\x1b[22m 2:0-31 \x1b[1m\x1b[36m\x1b[39m\x1b[22m\n      harmony import specifier \x1b[1m\x1b[36m./data.yaml\x1b[39m\x1b[22m \x1b[1m\x1b[35m./example.js\x1b[39m\x1b[22m 5:50-54 \x1b[1m\x1b[36m\x1b[39m\x1b[22m\n- \x1b[1m./example.js\x1b[39m\x1b[22m 353 bytes \x1b[1m\x1b[32m[built]\x1b[39m\x1b[22m\n+ \x1b[1m./example.js\x1b[39m\x1b[22m 354 bytes \x1b[1m\x1b[32m[built]\x1b[39m\x1b[22m\n      \x1b[1m\x1b[36m[no exports]\x1b[39m\x1b[22m\n      \x1b[1m\x1b[36m[used exports unknown]\x1b[39m\x1b[22m\n      entry \x1b[1m\x1b[36m./example.js\x1b[39m\x1b[22m \x1b[1m\x1b[35mnull\x1b[39m\x1b[22m main \x1b[1m\x1b[36m\x1b[39m\x1b[22m\ndiff --git a/examples/custom-json-modules/data.json b/examples/custom-json-modules/data.json5\nsimilarity index 88%\nrename from examples/custom-json-modules/data.json\nrename to examples/custom-json-modules/data.json5\nindex 4b5f9a609..37fb5e6f7 100644\n--- a/examples/custom-json-modules/data.json\n+++ b/examples/custom-json-modules/data.json5\n@@ -1,6 +1,6 @@\n {\n   // comment\n-  title: "TOML Example",\n+  title: "JSON5 Example",\n   owner: {\n     name: "Tom Preston-Werner",\n     organization: "GitHub",\ndiff --git a/examples/custom-json-modules/data.yaml b/examples/custom-json-modules/data.yaml\nindex 1e089e3c1..d0b37096a 100644\n--- a/examples/custom-json-modules/data.yaml\n+++ b/examples/custom-json-modules/data.yaml\n@@ -1,4 +1,4 @@\n-title: TOML Example\n+title: YAML Example\n owner:\n   name: Tom Preston-Werner\n   organization: GitHub\ndiff --git a/examples/custom-json-modules/example.js b/examples/custom-json-modules/example.js\nindex e94675e2b..d628768fe 100644\n--- a/examples/custom-json-modules/example.js\n+++ b/examples/custom-json-modules/example.js\n@@ -1,6 +1,6 @@\n import toml from "./data.toml";\n import yaml from "./data.yaml";\n-import json from "./data.json";\n+import json from "./data.json5";\n \n document.querySelector(\'#app\').innerHTML = [toml, yaml, json].map(data => `\n   <h1>${data.title}</h1>\ndiff --git a/examples/custom-json-modules/template.md b/examples/custom-json-modules/template.md\nindex 5ea5a00ae..b48dd0830 100644\n--- a/examples/custom-json-modules/template.md\n+++ b/examples/custom-json-modules/template.md\n@@ -17,7 +17,7 @@ _{{data.yaml}}_\n # data.json\n \n ```json5\n-_{{data.json}}_\n+_{{data.json5}}_\n ```\n \n # example.js\ndiff --git a/examples/custom-json-modules/webpack.config.js b/examples/custom-json-modules/webpack.config.js\nindex 7b456cde9..44fd78194 100644\n--- a/examples/custom-json-modules/webpack.config.js\n+++ b/examples/custom-json-modules/webpack.config.js\n@@ -15,7 +15,7 @@ module.exports = {\n \t\t\t\t}\n \t\t\t},\n \t\t\t{\n-\t\t\t\ttest: /\\.json$/,\n+\t\t\t\ttest: /\\.json5$/,\n \t\t\t\ttype: "json",\n \t\t\t\tparser: {\n \t\t\t\t\tparse(input) {\n', 'commit_subject': 'fix custom-json-modules example', 'repo_name': 'webpack/webpack', 'committer': {'name': 'Sergey Melyukov', 'email': '32ef9e362fb086ad15f87c44fc76cdabba36c7e0@gmail.com', 'time_sec': '1575040504', 'tz_offset': '180', 'date': {'seconds': '1575040504'}}, 'commit_tree': '395b0d12b5239da1ba68aaf173d926f3d83753a4', 'commit_message': 'fix custom-json-modules example\n', 'language_name': 'HTML', 'license': 'mit', 'hunks': '@@ -15,7 +15,7 @@ module.exports = {\n \t\t\t\t}\n \t\t\t},\n \t\t\t{\n-\t\t\t\ttest: /\\.json$/,\n+\t\t\t\ttest: /\\.json5$/,\n \t\t\t\ttype: "json",\n \t\t\t\tparser: {\n \t\t\t\t\tparse(input) {\n', 'addition_count': 1, 'deletion_count': 1, 'src_file': 'a/examples/custom-json-modules/webpack.config.js', 'tgt_file': 'b/examples/custom-json-modules/webpack.config.js', 'file_extension': '.js', 'before_file': 'const toml = require("toml");\nconst json5 = require("json5");\nconst yaml = require("yamljs");\n\nmodule.exports = {\n\tmodule: {\n\t\trules: [\n\t\t\t{\n\t\t\t\ttest: /\\.toml$/,\n\t\t\t\ttype: "json",\n\t\t\t\tparser: {\n\t\t\t\t\tparse: toml.parse\n\t\t\t\t}\n\t\t\t},\n\t\t\t\t}\n\t\t\t},\n\t\t\t{\n\t\t\t\ttest: /\\.json$/,\n\t\t\t\ttype: "json",\n\t\t\t\tparser: {\n\t\t\t\t\tparse(input) {\n\t\t\t{\n\t\t\t\ttest: /\\.yaml$/,\n\t\t\t\ttype: "json",\n\t\t\t\tparser: {\n\t\t\t\t\tparse: yaml.parse\n\t\t\t\t}\n\t\t\t}\n\t\t]\n\t}\n};\n', 'message': 'fix custom-json-modules example\n', 'author_name': 'Sergey Melyukov', 'lang': 'config'}