阅读本文时 article早些时候,我遇到了以下代码行:
import { run } from '@cycle/core';
这让我想到了以下问题:
- 如果有的话,
@
符号的意义是什么? import 'foo/bar'
和import '@foo/bar'
有区别吗?
它是解决特定类型模块的方法吗?
我对 ES6 比较陌生,虽然 import
语法对我来说似乎非常简单 - 除了在这种情况下,@
符号的神秘存在。
我尝试使用谷歌搜索,但找不到有关 Stack Overflow 的任何信息,MDN或其他地方。
最佳答案
来自 Getting Started文档:
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.
In case you are not dealing with a DOM-interfacing web application, you can omit @cycle/dom when installing.
关于javascript - JS - import '@foo/bar' 中@的含义,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33628522/