Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
importmap
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
importmap
Commits
a03b623e
Commit
a03b623e
authored
3 months ago
by
Ken Quiño
Committed by
Pierre Rudloff
3 months ago
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#3449305
by prudloff, sunil jolapara: README.md missing
parent
a48f7841
No related branches found
No related tags found
1 merge request
!3
3449305: Added README file.
Pipeline
#456250
passed
2 months ago
Stage: build
Stage: validate
Changes
2
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
.gitlab-ci.yml
+2
-4
2 additions, 4 deletions
.gitlab-ci.yml
README.md
+66
-0
66 additions, 0 deletions
README.md
with
68 additions
and
4 deletions
.gitlab-ci.yml
+
2
−
4
View file @
a03b623e
...
...
@@ -23,7 +23,5 @@ include:
# https://git.drupalcode.org/project/gitlab_templates/-/blob/main/includes/include.drupalci.variables.yml
# Uncomment the lines below if you want to override any of the variables. The following is just an example.
################
# variables:
# SKIP_ESLINT: '1'
# OPT_IN_TEST_NEXT_MAJOR: '1'
# _CURL_TEMPLATES_REF: 'main'
variables
:
_CSPELL_WORDS
:
'
gaël,
gaëlg,
gosset,
prudloff,
rudloff'
This diff is collapsed.
Click to expand it.
README.md
0 → 100644
+
66
−
0
View file @
a03b623e
# Import map
This module allows you to add an import map to your website. It can be used to
enable JS imports without requiring the full path to the JS file.
For a full description of the module, visit the
[
project page
](
https://www.drupal.org/project/importmap
)
.
Submit bug reports and feature suggestions, or track changes in the
[
issue queue
](
https://www.drupal.org/project/issues/importmap
)
.
## Requirements
This module requires no modules outside of Drupal core.
## Installation
Install as you would normally install a contributed Drupal module. For further
information, see
[
Installing Drupal Modules
](
https://www.drupal.org/docs/extending-drupal/installing-drupal-modules
)
.
## Configuration
The module has no menu or modifiable settings. There is no configuration.
## Usage Example
For example, if you have this in your
`libraries.yml`
file:
```
yaml
foo
:
js
:
js/foo.js
:
{
attributes
:
{
data-importmap-name
:
'
foo'
}
}
```
It will generate this import map:
```
html
<script
type=
"importmap"
>
{
"
imports
"
:{
"
foo
"
:
"
\
/modules
\
/custom
\
/foo
\
/js
\
/foo.js?s3pik6
"
}}
</script>
```
And you can then use
`import { foo } from "foo";`
in your JS to import this file.
(Note that JS scripts that use
`import`
need to have the
`type="module"`
attribute.)
You do not have to attach libraries that are in the import map, they will be
downloaded automatically by the browser when using import.
## Preloading modules
You can also preload JS modules like this:
```
yaml
foo
:
js
:
js/foo.js
:
{
attributes
:
{
data-importmap-name
:
'
foo'
,
data-importmap-preload
:
true
}
}
```
This will make the browser preload the JS module so it can already be available
when executing the
`import`
.
## Maintainers
-
Pierre Rudloff -
[
prudloff
](
https://www.drupal.org/u/prudloff
)
-
Gaël Gosset -
[
gaëlg
](
https://www.drupal.org/u/gaëlg
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment