-3
rated 0 times
[
4]
[
7]
/ answers: 1 / hits: 17707
/ 7 Years ago, sat, september 30, 2017, 12:00:00
I use react and webpack to build web SPA but, typescript can't find resolve the less file
work file like this ⬆️
More From » reactjs
I use react and webpack to build web SPA but, typescript can't find resolve the less file
work file like this ⬆️
Just create a new declaration file (externals.d.ts
) with declare module '*.less'
.
Edit
If you are using css-modules, you can define these types to match the return value:
declare module '*.less' {
const resource: {[key: string]: string};
export = resource;
}
Add that file to the includes
array of your tsconfig.json
file.
// tsconfig.json
{
compilerOptions: {...}
includes: [
'./path/to/the/new/file/externals.d.ts'
]
}