All Projects → longlho → Ts Transform Css Modules

longlho / Ts Transform Css Modules

Licence: mit
Extract css class names from required css module files for TypeScript

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to Ts Transform Css Modules

Ts Transform Import Path Rewrite
TS AST transformer to rewrite import path
Stars: ✭ 104 (+38.67%)
Mutual labels:  compiler, ast, transform
Llvm Guide Zh
User Guides For those new to the LLVM system.(LLVM系统的新用户指南,中文翻译版)
Stars: ✭ 180 (+140%)
Mutual labels:  compiler, ast
Lioness
The Lioness Programming Language
Stars: ✭ 155 (+106.67%)
Mutual labels:  compiler, ast
ts-transform-react-constant-elements
A TypeScript AST Transformer that can speed up reconciliation and reduce garbage collection pressure by hoisting React elements to the highest possible scope.
Stars: ✭ 44 (-41.33%)
Mutual labels:  ast, transform
Charly Vm
Fibers, Closures, C-Module System | NaN-boxing, bytecode-VM written in C++
Stars: ✭ 66 (-12%)
Mutual labels:  compiler, ast
Babel
🐠 Babel is a compiler for writing next generation JavaScript.
Stars: ✭ 40,109 (+53378.67%)
Mutual labels:  compiler, ast
Cub
The Cub Programming Language
Stars: ✭ 198 (+164%)
Mutual labels:  compiler, ast
Snapdragon
snapdragon is an extremely pluggable, powerful and easy-to-use parser-renderer factory.
Stars: ✭ 180 (+140%)
Mutual labels:  compiler, ast
Exprtk
C++ Mathematical Expression Parsing And Evaluation Library
Stars: ✭ 301 (+301.33%)
Mutual labels:  compiler, ast
Ratel Core
High performance JavaScript to JavaScript compiler with a Rust core
Stars: ✭ 367 (+389.33%)
Mutual labels:  compiler, ast
Tiny Compiler
A tiny compiler for a language featuring LL(2) with Lexer, Parser, ASM-like codegen and VM. Complex enough to give you a flavour of how the "real" thing works whilst not being a mere toy example
Stars: ✭ 425 (+466.67%)
Mutual labels:  compiler, ast
Tiny Compiler
A tiny evaluator and compiler of arithmetic expressions.
Stars: ✭ 680 (+806.67%)
Mutual labels:  compiler, ast
Pyast64
Compile a subset of the Python AST to x64-64 assembler
Stars: ✭ 93 (+24%)
Mutual labels:  compiler, ast
Phplrt
PHP Language Recognition Tool
Stars: ✭ 127 (+69.33%)
Mutual labels:  compiler, ast
ts-transform-react-jsx-source
TypeScript AST Transformer that adds source file and line number to JSX elements
Stars: ✭ 12 (-84%)
Mutual labels:  ast, transform
Webassemblyjs
Toolchain for WebAssembly
Stars: ✭ 566 (+654.67%)
Mutual labels:  compiler, ast
Modiscript
Acche din aa gaye
Stars: ✭ 888 (+1084%)
Mutual labels:  compiler, ast
Seeless
C IDE for iOS
Stars: ✭ 71 (-5.33%)
Mutual labels:  compiler
Shaderconductor
ShaderConductor is a tool designed for cross-compiling HLSL to other shading languages
Stars: ✭ 1,146 (+1428%)
Mutual labels:  compiler
Certicoq
A Verified Compiler for Gallina, Written in Gallina
Stars: ✭ 66 (-12%)
Mutual labels:  compiler

ts-transform-css-modules

Greenkeeper badge npm version travis

Extract css class names from required css module files for TypeScript. This plugin is based on css-modules-require-hook and so constructor opts are from that repo.

This allows you to do this in TS files:

// Import works
import * as css from 'foo.css'
// require also works
const foo = require('foo.css')

console.log(css.foo)

Append this to before in your compilation step. See compile.ts for more info.

Right now named imports will not work due to TS mangling import name after compilation.

// Those are NOT working
import css from 'foo.css'
import { button, badge } from 'foo.css'

Options

See css-modules-require-hook for a list of options.

Custom Options

tsImportResolver (path: string): string: This callback function allows you to override import path in ImportDeclaration for every CSS file we encounter. This is useful when dealing with project that uses paths aliases in tsconfig. This might not be necessary once https://github.com/Microsoft/TypeScript/issues/28276 is resolved.

Caveats

  1. Source map support might not be entirely accurate
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].