sonofmagic / weapp-tailwindcss

bring tailwindcss to weapp ! 把 `tailwindcss` 原子化**带入小程序开发吧 ! 原 `weapp-tailwindcss-webpack-plugin`

Home Page:https://weapp-tw.icebreaker.top

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

是否支持引用外部包组件?

Ceelog opened this issue · comments

commented

在 uni-app 开发小程序的时候,引入外部包的组件:

import Cell from '@mypkg/src/components/Cell.vue'

这个组件也使用了 tailwindcss,但是最后编译打包的时候,并没有将 Cell.vue 中 util class 转义到小程序 app.wxss 文件中

请问:weapp-tailwindcss 不支持这种引入外部组件的场景吗?

commented
  • 只有在 tailwind.config.js 的 content配置中,包括的会被提取,生成css,例如:
module.exports = {
  content: [
    './index.html',
    './src/**/*.{html,js,ts,jsx,tsx,vue}',
    './node_modules/mypkg/src/components/**/*.{html,js,ts,jsx,tsx,vue}'
  ]
}