webpack-bem-loader
webpack-bem-loader copied to clipboard
TypeScript support
Now it works only by this way:
import * as Search from 'b:Search';
console.log(Search);
Because we transpile it to:
const Search = ((
(__webpack_require__(2).default || __webpack_require__(2)).applyDecls()
));
// ts use it like this
console.log(Search);
But! If we want use default export only:
import Search from 'b:Search';
console.log(Search);
const Search = ((
(__webpack_require__(2).default || __webpack_require__(2)).applyDecls()
));
// ts use it like this
console.log(Search.default); // .default -> undefined
We need to transpile it like this:
const Search = {
default: ((
(__webpack_require__(2).default || __webpack_require__(2)).applyDecls()
))
};
Lisp (no):
const Search = {
default: ((
( (x=>(x.default||x))(__webpack_require__(2)) ).applyDecls()
))
};
@zxqfox

we don't work with import we work with require
IT DOES WORK!!!
Guys, why not to use:
declare module 'b:button m:type:radio' {
etc.
}