From 8e251ab306cc4f6f1346df0dd2f4b9f3dea97da0 Mon Sep 17 00:00:00 2001 From: Ilya Kantor Date: Fri, 10 May 2019 10:43:10 +0300 Subject: [PATCH] explanations --- 1-js/13-modules/01-modules-intro/article.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/1-js/13-modules/01-modules-intro/article.md b/1-js/13-modules/01-modules-intro/article.md index ad4f2106..af2b427a 100644 --- a/1-js/13-modules/01-modules-intro/article.md +++ b/1-js/13-modules/01-modules-intro/article.md @@ -301,14 +301,14 @@ There are two notable differences of external module scripts: That ensures better security by default. -### No bare modules allowed +### No "bare" modules allowed -In the browser, in scripts (not in HTML), `import` must get either a relative or absolute URL. So-called "bare" modules, without a path, are not allowed. +In the browser, in scripts (not in HTML), `import` must get either a relative or absolute URL. Modules without any path are called "bare" modules. Such modules are not allowed in `import`. For instance, this `import` is invalid: ```js import {sayHi} from 'sayHi'; // Error, "bare" module -// must be './sayHi.js' or wherever the module is +// the module must have a path, e.g. './sayHi.js' or wherever the module is ``` Certain environments, like Node.js or bundle tools allow bare modules, as they have own ways for finding modules and hooks to fine-tune them. But browsers do not support bare modules yet. @@ -328,7 +328,7 @@ Old browsers do not understand `type="module"`. Scripts of the unknown type are ``` -If we use bundle tools, then as modules are bundled together, their `import/export` statements are replaced by special bundler calls, so the resulting build does not require `type="module"`, and we can put it into a regular script: +If we use bundle tools, then as scripts are bundled together into a single file (or few files), `import/export` statements inside those scripts are replaced by special bundler functions. So the resulting "bundled" script does not contain any `import/export`, it doesn't require `type="module"`, and we can put it into a regular script: ```html