作者感觉挺强的,给了star 

https://github.com/Binbiubiubiu/taro-plugin-style-resource

 安装 taro-plugin-style-resource

npm i taro-plugin-style-resource

# yarn
yarn add taro-plugin-style-resource

使用插件

/config/index.js

const path = require("path");
// 示例, 如果你使用 `vs code` 作为开发工具, 你还可以使用注释的语法引入插件包含的声明文件,可获得类似于typescript的友好提示
/**
 * @typedef { import("taro-plugin-style-resource").PluginOptions } PluginOptions
 * @type {PluginOptions}
 */
const pluginOptions = {
  less: {
    patterns: [path.resolve(__dirname, "..", "src/styles/index.less")],
  },
};
const config = {
  plugins: [["taro-plugin-style-resource", pluginOptions]],
};

Logo

瓜分20万奖金 获得内推名额 丰厚实物奖励 易参与易上手

更多推荐