Neon loader for webpack using David Matějka's neon-js.
npm install neon-loader
module.exports = {
module: {
rules: [
{
test: /\.neon$/,
use: 'neon-loader'
}
]
}
}
import config from 'config.neon';
webpack --module-bind 'neon=neon-loader'
import config from 'config.neon';
import config from 'neon-loader!config.neon');
By default, neon-js
detects if the loaded file contains a list and returns a JS array if so. You can use this option to force 'neon-js' to transform lists into objects:
import listObject from 'neon-loader?forceObject!list.neon';