JS-导入'@ foo/bar'中@的含义 [英] JS - meaning of @ in import '@foo/bar'

查看:42
本文介绍了JS-导入'@ foo/bar'中@的含义的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

阅读本文章之前,我遇到了以下代码行:

While reading this article earlier, I came across the following line of code:

import { run } from '@cycle/core';

这导致我提出以下问题:

Which led me to the following questions:

  • @ 符号(如果有)的含义是什么?
  • import'foo/bar' import'@ foo/bar'之间是否有区别?
  • What is the significance of the @ symbol, if any?
  • Is there a difference between import 'foo/bar' and import '@foo/bar'?

这是解决特定类型模块的一种方法吗?

Is it a way to resolve a particular type of module?

我对ES6还是比较陌生,尽管 import 语法对我来说似乎很简单-在这种情况下,除了 @ 符号的隐含存在之外.

I'm relatively new to ES6, although the import syntax seems pretty straightforward to me - except, in this case, for the cryptic presence of the @ symbol.

我尝试使用Google搜索,但找不到有关Stack Overflow的任何信息, MDN 或其他地方.

I tried googling but couldn't find any information on Stack Overflow, MDN or elsewhere.

推荐答案

入门文档:

@ org/packages类型的软件包是npm范围内的软件包,受支持如果您的npm安装版本为2.11或更高版本.检查你的npmnpm --version版本并进行升级,以安装Cycle.js.

Packages of the type @org/package are npm scoped packages, supported if your npm installation is version 2.11 or higher. Check your npm version with npm --version and upgrade in order to install Cycle.js.

如果您不使用DOM接口的Web应用程序,您可以在安装时省略@ cycle/dom.

In case you are not dealing with a DOM-interfacing web application, you can omit @cycle/dom when installing.

这篇关于JS-导入'@ foo/bar'中@的含义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆