I have a config setting I'd like to include in Brocfile.js, so that I don't set it in the file directly. For example, in config/custom.js I would have something like:
export default {
path: 'http://abc.blah.com/'
};
In my Brocfile, I'd like to do something like:
if (process.env.EMBER_ENV === 'development') {
app.options.inlineContent = {
assetPrefix: {
content: customConfig.path
}
};
}
How do I import/include custom.js in my Brocfile, and use its path property? I tried importing, but get:
import config from 'config/custom.js';
^^^^^^
Unexpected reserved word
UPDATE:
Based on the answer below, here's what my files ended up looking like:
// config/custom.js
module.exports = {
assetPrependPath: 'http://abc.blah.com/'
};
// Brocfile.js
var customConfig = require('./config/custom');
...
if (process.env.EMBER_ENV === 'development') {
app.options.inlineContent = {
assetPrefix: {
content: customConfig.assetPrependPath
}
};
}