New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

babel-plugin-vue-jsx-scoped-css

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-vue-jsx-scoped-css

:hammer: CSS encapsulation solution for Vue JSX

  • 0.0.2
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

babel-plugin-vue-jsx-scoped-css

Downloads Version License

:hammer: CSS encapsulation solution for Vue JSX

About

This plugin is used to implement the css scoped effect of template in vue jsx。

For more details, please refer to react-scoped-css

Use

You have to add one babel plugin and one webpack loader.

Babel

yarn add babel-plugin-vue-jsx-scoped-css --dev

and in your babelrc add

{
    "presets": ["@vue/babel-preset-jsx"],
    "plugins": ["babel-plugin-vue-jsx-scoped-css"]
}

also note that you can define your own matching rule like this

{
    "plugins": [
        [
            "babel-plugin-vue-jsx-scoped-css",
            {
                "include": ".local.(sa|sc|c)ss$"
            }
        ]
    ]
}

This plugin must be before the vue jsx parsing plugin.

Webpack

yarn add scoped-css-loader --dev

and in your webpack.config.js

{
    "test": /\.(sc|c|sa)ss$/,
    "use": [
        {
            "loader": "style-loader"
        },
        {
            "loader": "css-loader",
            "options": {
                "sourceMap": true,
                "importLoaders": 2
            }
        },
        // You have to put in after `css-loader` and before any `pre-precessing loader`
        { "loader": "scoped-css-loader" },
        {
            "loader": "sass-loader"
        }
    ]
}

FAQs

Package last updated on 07 Oct 2019

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