ts-transform-css-modules:从TypeScript所需的css模块文件中提取css类名

时间:2021-01-31 13:52:49
【文件属性】:
文件名称:ts-transform-css-modules:从TypeScript所需的css模块文件中提取css类名
文件大小:28KB
文件格式:ZIP
更新时间:2021-01-31 13:52:49
css typescript compiler css-modules ast ts-transform-css-modules 从TypeScript所需的css模块文件中提取css类名。 这个插件是基于,因此构造函数的选择来自该仓库。 这使您可以在TS文件中执行此操作: // Import works import * as css from 'foo.css' // require also works const foo = require ( 'foo.css' ) console . log ( css . foo ) 在编译步骤中将此附加到before 。 有关更多信息,请参见 。 由于编译后TS修改了导入名称,因此,现在命名的导入将不起作用。 // Those are NOT working import css from 'foo.css' import { button , badge } from 'foo.css' 选件 有关选项列表,请参见 。 自订选项 tsImportResolver (path: string): string :此回调函数使您可以为遇到的每个CSS文件覆盖ImportDeclaration导入路径。 当
【文件预览】:
ts-transform-css-modules-master
----.gitignore(624B)
----tsconfig.json(506B)
----README.md(2KB)
----.github()
--------workflows()
----test()
--------fixture()
--------index.test.ts(1KB)
----LICENSE(1KB)
----package.json(1KB)
----src()
--------index.ts(51B)
--------transform.ts(5KB)
----compile.ts(2KB)
----.npmignore(4B)
----package-lock.json(64KB)

网友评论