*.properties
loader for webpack
npm install json-loader enhanced-properties-loader --save-dev
or
yarn add json-loader enhanced-properties-loader --dev
./index.properties
foo=bar
bar.baz=qux
./index.js
var properties = require('!json!enhanced-properties!./index.properties');
console.log(properties); // Object { foo: "bar", bar: { baz: "qux" } }
./webpack.config.js
module.exports = {
module: {
rules: [{
test: /\.properties$/,
loader: 'enhanced-properties-loader'
}]
}
};