I am having trouble with writing functions in arrays.
Here is what happens:
config.js
module.exports = {
transformers: {
reshape: {
parser: 'sugarml',
plugins: [
// require('reshape-custom-elements')({defaultTag: 'span'})
function () {
console.log(arguments)
}
]
}
}
}
Then in the node REPL
var config = require('./config.js')
console.log(JSON.stringify(config.transformers, null, 2))
It outputs
{
"reshape": {
"parser": "sugarml",
"plugins": [
null
]
},
"uglify-js": {
"mangle": {
"toplevel": true
}
},
"rollup": {
"format": "es",
"plugins": {
"rollup-plugin-node-resolve": {},
"rollup-plugin-commonjs": {}
}
}
}
I am confused why plugins is [null]
JSON.stringify