webpack/examples/custom-json-modules/webpack.config.js

34 lines
441 B
JavaScript
Raw Normal View History

"use strict";
const json5 = require("json5");
2025-07-03 17:06:45 +08:00
const toml = require("toml");
const yaml = require("yamljs");
2019-11-29 01:12:11 +08:00
module.exports = {
module: {
rules: [
{
test: /\.toml$/,
type: "json",
parser: {
parse: toml.parse
2019-11-29 01:12:11 +08:00
}
},
{
2019-11-29 23:15:04 +08:00
test: /\.json5$/,
type: "json",
parser: {
parse: json5.parse
}
},
{
test: /\.yaml$/,
type: "json",
parser: {
parse: yaml.parse
}
2019-11-29 01:12:11 +08:00
}
]
}
};