10 Matching Annotations
- Sep 2021
-
betterprogramming.pub betterprogramming.pub
-
From my point of view, this approach will help you to write cleaner code. Also, it will help to maintain the project. For instance, moving a file from the current directory to another will cause fewer problems, because every file uses an absolute path instead of a relative one. Last but not least, it helps you during development.
-
-
blog.johnnyreilly.com blog.johnnyreilly.com
-
import * as utils from '../../../../../../../shared/utils';
-
-
-
-
Saying that web devs used to be fine with relative imports is like saying that human beings used to be fine living without refrigerators. Sure we did. But was it better than it is now? No. No, it wasn't.
-
- Nov 2020
-
www.npmjs.com www.npmjs.comtspath1
-
Everyone working in a TypeScript project that grows beyond a certains limit will eventually experience the situation commonly described as path hell, the snippet below is an example of such hell.
Tags
Annotators
URL
-
-
www.npmjs.com www.npmjs.com
-
No more shit-coding paths in Node like so:
-
-
stackoverflow.com stackoverflow.com
-
I was reading about path-mapping in tsconfig.json and I wanted to use it to avoid using the following ugly paths:
-
-
stackoverflow.com stackoverflow.com
-
However, I just went through the same exercise of moving from relative paths everywhere to module paths.
-
-
sass-lang.com sass-lang.com
-
Unlike some other languages, Sass doesn’t require that you use ./ for relative imports. Relative imports are always available.
-
-
www.npmjs.com www.npmjs.com
-
The sass-loader uses Sass's custom importer feature to pass all queries to the Webpack resolving engine. Thus you can import your Sass modules from node_modules. Just prepend them with a ~ to tell Webpack that this is not a relative import: @import '~bootstrap';
-