Other Frameworks
tip
These instructions will work if you have ejected from Create React App.
If you DO NOT have a babel.config.js
file
Create a babel.config.js
file in the root of your project:
const babel = {};
if (process.env.MIGHTYMELD) {
babel.plugins = ['@mightymeld/runtime/babel-plugin-mightymeld'];
}
module.exports = babel;
If you have a babel.config.js
file
If your existing config file looks like this:
babel.config.js
module.exports = {
presets: [...],
plugins: [...]
};
First use a variable to store the config so you can modify if conditionally:
babel.config.js
const babel = {
presets: [...],
plugins: [...]
};
module.exports = babel;
Then add the MightyMeld plugin:
babel.config.js
const babel = {
presets: [...],
plugins: [...]
};
if (process.env.MIGHTYMELD) {
babel.plugins.push('@mightymeld/runtime/babel-plugin-mightymeld');
}
module.exports = babel;
If you have a babel.config.json
or .babelrc.json
file
First convert your existing file from JSON to JavaScript so you can make the conditional check for
MIGHTYMELD
.
If your existing config file looks like this:
babel.config.json
{
"presets": [...],
"plugins": [...]
}
Convert it to JavaScript like this:
babel.config.js
const babel = {
presets: [...],
plugins: [...]
};
module.exports = babel;
Then add the MightyMeld plugin:
babel.config.js
const babel = {
presets: [...],
plugins: [...]
};
if (process.env.MIGHTYMELD) {
babel.plugins.push('@mightymeld/runtime/babel-plugin-mightymeld');
}
module.exports = babel;
If your framework does not use Babel, or does not recognize the babel.config.js
file
We have experience setting up MightyMeld on other frameworks such as Umi. If you are using a framework for which you don’t see instructions here, please contact us and we’ll help you get set up.