This is a craco plugin that adds twig-loader to create-react-app version >= 2.
First, follow the craco
Installation Instructions to install the craco
package, create a craco.config.js
file, and modify the scripts in your package.json
.
Then install craco-twig-loader
:
$ yarn add craco-twig-loader
# OR
$ npm i -S craco-twig-loader
Here is a complete craco.config.js
configuration file that adds raw-loader to create-react-app
:
const CracoTwigLoaderPlugin = require("craco-twig-loader");
module.exports = {
plugins: [{ plugin: CracoTwigLoaderPlugin }]
};
This is heavily borrowed from @baristalabs/craco-raw-loader