Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

stylus-loader

Package Overview
Dependencies
Maintainers
3
Versions
57
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

stylus-loader

Stylus loader for webpack

  • 8.1.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.8M
decreased by-9.26%
Maintainers
3
Weekly downloads
 
Created

What is stylus-loader?

The stylus-loader npm package is a utility that allows you to load and compile Stylus files directly in Webpack. This integration facilitates the use of Stylus, a pre-processor for CSS, enabling developers to write cleaner and more efficient style sheets by utilizing variables, functions, and mixins.

What are stylus-loader's main functionalities?

Loading and Compiling Stylus Files

This feature allows developers to integrate Stylus files into their Webpack build process. The provided code configures Webpack to use stylus-loader along with css-loader and style-loader to process files ending in .styl, compile them into CSS, and inject them into the DOM.

module.exports = {
  module: {
    rules: [
      {
        test: /\.styl$/,
        use: [
          'style-loader',
          'css-loader',
          'stylus-loader'
        ]
      }
    ]
  }
};

Custom Import Paths

This feature allows the specification of custom paths where Stylus files are located, making it easier to organize and maintain stylesheets. The code sample demonstrates how to add custom paths to the stylus-loader configuration in Webpack.

module.exports = {
  module: {
    rules: [
      {
        test: /\.styl$/,
        use: [
          'style-loader',
          'css-loader',
          {
            loader: 'stylus-loader',
            options: {
              paths: ['node_modules', 'path/to/import/dir']
            }
          }
        ]
      }
    ]
  }
};

Other packages similar to stylus-loader

Keywords

FAQs

Package last updated on 18 Sep 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc