You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: 1-js/13-modules/01-modules-intro/article.md
+4-4
Original file line number
Diff line number
Diff line change
@@ -301,14 +301,14 @@ There are two notable differences of external module scripts:
301
301
302
302
That ensures better security by default.
303
303
304
-
### No bare modules allowed
304
+
### No "bare" modules allowed
305
305
306
-
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.
306
+
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`.
//the module must have a path, e.g. './sayHi.js' or wherever the module is
312
312
```
313
313
314
314
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
328
328
</script>
329
329
```
330
330
331
-
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:
331
+
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:
332
332
333
333
```html
334
334
<!-- Assuming we got bundle.js from a tool like Webpack -->
0 commit comments