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

32 lines
426 B
JavaScript

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: /\.json5$/,
type: "json",
parser: {
parse: json5.parse
}
},
{
test: /\.yaml$/,
type: "json",
parser: {
parse: yaml.parse
}
}
]
}
};