
Security News
Security Community Slams MIT-linked Report Claiming AI Powers 80% of Ransomware
Experts push back on new claims about AI-driven ransomware, warning that hype and sponsored research are distorting how the threat is understood.
@kokojs/plugin-style
Advanced tools
`@kokojs/plugin-style` 提供了预处理 CSS 的能力,支持 Sass 语法,不再支持原有的 precss、sass-like 等语法。
@kokojs/plugin-style 提供了预处理 CSS 的能力,支持 Sass 语法,不再支持原有的 precss、sass-like 等语法。
yarn add @kokojs/plugin-style --dev
安装完成后,在 koko.config.js 中添加如下配置:
module.exports = {
  plugins: {
    style: {},
  },
};
booleantrue是否将样式提取至独立的 CSS 文件中。
禁用该选项时,样式将打包到 JS 文件中,并通过 style-loader 注入到页面上。
PostcssPlugin[]undefinedkoko-plugin-style 默认包含 autoprefixer 插件,通过此选项可以配置额外的 postcss 插件
// koko.config.js
module.exports = {
  plugins: {
    style: {
      postcssPlugins: [require('some-postcss-plugin')],
    },
  },
};
object-传递给 loader 的选项,支持以下 loader:
// koko.config.js
module.exports = {
  plugins: {
    style: {
      loaderOptions: {
        css: {
          // css-loader 选项
        },
        sass: {
          // sass-loader 选项
        },
        style: {
          // style-loader 选项,仅在设置 extract: false 后有效
        },
        postcss: {
          // postcss-loader 选项
        },
      },
    },
  },
};
booleanfalse是否在 dev 模式下启用 postcss 的 autoprefixer 插件,注意开启后会降低 dev 的编译速度。
默认情况下,我们仅在 build 阶段启用 postcss 和 autoprefixer 插件。
(extract?: boolean) => stringstyle-loader加载自定义 style-loader 的方法,可用于替换内置的默认样式注入行为。
// koko.config.js
module.exports = {
  plugins: {
    style: {
      customStyleLoader: () => require.resolve('./my-style-loader'),
    },
  },
};
booleanfalse当 globalModules 为 true 时,所有样式文件都会开启 CSS Modules。
koko 根据文件后缀名来判断是否启用 CSS Modules:
.css 和 .scss 文件默认不支持 CSS Modules,若 globalModules 为 true,则支持 CSS Modules,作用域为 :global.m.css 和 .m.scss 文件支持 CSS Modules,默认作用域为 :local.global.m.css 和 .global.m.scss 文件支持 CSS Modules,默认作用域为 :global陈嘉涵。
FAQs
`@kokojs/plugin-style` 提供了预处理 CSS 的能力,支持 Sass 语法,不再支持原有的 precss、sass-like 等语法。
The npm package @kokojs/plugin-style receives a total of 527 weekly downloads. As such, @kokojs/plugin-style popularity was classified as not popular.
We found that @kokojs/plugin-style demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?

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.

Security News
Experts push back on new claims about AI-driven ransomware, warning that hype and sponsored research are distorting how the threat is understood.

Security News
Ruby's creator Matz assumes control of RubyGems and Bundler repositories while former maintainers agree to step back and transfer all rights to end the dispute.

Research
/Security News
Socket researchers found 10 typosquatted npm packages that auto-run on install, show fake CAPTCHAs, fingerprint by IP, and deploy a credential stealer.