babel-plugin-tcon

1.0.13 • Public • Published

babel-plugin-tcon

安装

xnpm i babel-plugin-tcon --save-dev

# or npm

npm i babel-plugin-tcon --save-dev

添加到 plugin,指定样式文件夹

{
  "plugins": [
    "babel-plugin-tcon"
  ]
}

当使用 tcon-cli 定制样式到项目后,需要指定样式目录

{
  "plugins": [
    [
      "babel-plugin-tcon", {
        "libPath": "style/tcon" 
      }
    ]
  ]
}

例如,默认是使用 alias @,在项目中一般把他设置为 src/ 目录。

import 'tcon/button/size/layout'

// ===>

import '@/style/tcon/button.css'
import '@/style/tcon/size.css'
import '@/style/tcon/layout.css'

也可以不使用 alias

{
  "plugins": [
    [
      "babel-plugin-tcon", {
        "libPath": "src/style/tcon",
        "noAlias": true
      }
    ]
  ]
}

这样便需要手动指定 src 目录了

import 'tcon/button'

// ===>

import './src/style/tcon/button.css'

Readme

Keywords

none

Package Sidebar

Install

npm i babel-plugin-tcon

Weekly Downloads

1

Version

1.0.13

License

ISC

Unpacked Size

3.03 kB

Total Files

3

Last publish

Collaborators

  • jmingzi