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

@stylin/msa-loader

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@stylin/msa-loader

Stylin loader module for webpack

  • 0.1.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

@stylin/msa-loader

The primary webpack loader for generation Mapping Style Annotations.

Installation

npm install --save-dev @stylin/msa-loader

You need to install style-loader or mini-css-extract-plugin:

npm install --save-dev style-loader
// or
npm install --save-dev mini-css-extract-plugin

⚠ Important

Don't install both, use one of them.

npm install --save-dev sass-loader

In webpack configuration file, place @stylin/msa-loader after style-loader or mini-css-extract-plugin in modules/rules.

webpack.config.js configuration with style-loader:

module.exports = {
  module: {
    rules: [{
      test: /\.scss$/i,
      use: [
        `@stylin/ts-loader`, // only if you use TypeScript
        `@stylin/msa-loader`,
        `style-loader`,
        {loader: `css-loader`, options: {modules: true}},
        `sass-loader`, // optional
      ],
    }],
  }
}

webpack.config.js configuration with MiniCssExtractPlugin:

const MiniCssExtractPlugin = require(`mini-css-extract-plugin`)

module.exports = {
  plugins: [new MiniCssExtractPlugin()],
  ...
  module: {
    rules: [{
      test: /\.scss$/i,
      use: [
        `@stylin/ts-loader`,  // only if you use TypeScript
        `@stylin/msa-loader`,
        {
          loader: MiniCssExtractPlugin.loader,
          options: {publicPath: `folder-where-css-files-will-be-stored`}
        },
        {loader: `css-loader`, options: {modules: true}},
        `sass-loader`, // optional
      ],
    }],
  }
}

⚠ Important

Set modules to true in options of css-loader:

{loader: 'css-loader', options: {modules: true}}

FAQs

Package last updated on 20 Feb 2021

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