use_loader_style: Use Styles Loader

View source: R/loaders.R

use_loader_styleR Documentation

Use Styles Loader

Description

Installs loaders and adds relevant configuration rules to srcjs/config/loaders.json, the function use_loader_style is recommended.

Usage

use_loader_css(test = "\\.css$", import = TRUE, modules = TRUE)

use_loader_sass(test = "\\.s[ac]ss$/i")

use_loader_style(test = "\\.css$", import = TRUE, modules = TRUE)

Arguments

test

Test regular expression test which files should be transformed by the loader.

import

Whether to enable import statements for .css files. If FALSE use require.

modules

Enables CSS modules and their config, a complex but powerful feature detailed here

Details

This will let you import styles much like any other modules, e.g.: import './styles.css'.

Packages

  • use_loader_css() - installs and imports css-loader packages as dev.

  • use_loader_style() - installs and imports style-loader and css-loader packages as dev. This loader enabled CSS modules.

  • use_loader_sass() - installs and imports style-loader, css-loader, and sass-loader as dev.


packer documentation built on May 28, 2022, 5:06 p.m.