/craco-twig-loader

A twig-loader plugin for craco / react-scripts / create-react-app

Primary LanguageJavaScript

Craco Twig-Loader Plugin

This is a craco plugin that adds twig-loader to create-react-app version >= 2.

Installation

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

Usage

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 }]
};

Inspiration

This is heavily borrowed from @baristalabs/craco-raw-loader

License

MIT