Skip to main content

Other Frameworks

tip

Many applications do not require this plugin. Unless you have been directed here by other documentation, you can probably skip these instructions. See “Should I install the plugin?” for more information.

tip

These instructions will work if you have ejected from Create React App.

Start by installing the mightymeld package in your project:

npm install --save-dev mightymeld

Then, follow the directions below.

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/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/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/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.