euclidr / notes

notes of something
0 stars 0 forks source link

Typescript import 路径 #1

Open euclidr opened 2 years ago

euclidr commented 2 years ago

import 'element-ui/lib/theme-chalk/index.css'; import './icons'; import '@/scss/index.scss';

euclidr commented 2 years ago
Module imports are resolved differently based on whether the module reference is relative or non-relative.

A relative import is one that starts with /, ./ or ../. Some examples include:

import Entry from "./components/Entry";
import { DefaultHeaders } from "../constants/http";
import "/mod";
Any other import is considered non-relative. Some examples include:

import * as $ from "jquery";
import { Component } from "@angular/core";
A relative import is resolved relative to the importing file and cannot resolve to an ambient module declaration. You should use relative imports for your own modules that are guaranteed to maintain their relative location at runtime.

A non-relative import can be resolved relative to [baseUrl](https://www.typescriptlang.org/tsconfig#baseUrl), or through path mapping, which we’ll cover below. They can also resolve to [ambient module declarations](https://www.typescriptlang.org/docs/handbook/modules.html#ambient-modules). Use non-relative paths when importing any of your external dependencies.
euclidr commented 2 years ago

@ 的意义

https://stackoverflow.com/questions/37372816/what-does-symbol-mean-in-import-component-from-angular-core-statem