Skip to content

样式关键词编译

scss 链接的关键词编译,替换关键词 @TIP_MODULE_STYLE_NAME已不建议使用。

如何使用

安装

bash
pnpm add @plugin-light/webpack-loader-cross-module-style -D

vue.config.js 中添加如下设置:

js
const { LOADER: crossModuleStyle } = require('@plugin-light/webpack-loader-cross-module-style');

module.export = {
  chainWebpack(config) {
    config.module
      .rule('vue')
      .test(/\.vue$/)
      .use(crossModuleStyle) 
      .loader(crossModuleStyle)
      .options({
        target: 'gp',
      })
      .end();
  }
}

参数

ts
export type ICrossModuleStyleOptions = {
  target?: string;
};

更新日志

点此查看