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
All notable changes to [rollup-plugin-import-maps](https://www.npmjs.com/package/rollup-plugin-import-maps) will be documented in this file.
4
+
5
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
+
7
+
8
+
9
+
## [0.2.0] - 2020-06-07
10
+
11
+
### Added
12
+
13
+
+`options.srcText` to use text as importmap source
14
+
+`options.transformingReport` to save transforming report as a file
15
+
+`options.noTransforming` to only mark specifiers defined in importmap as external without transforming
16
+
+`options.exclude` to skip specifiers from resoving
17
+
18
+
### Changed
19
+
20
+
+ dropped use of `Buffer` as `options.srcObject`
21
+
22
+
23
+
24
+
## [0.1.1] - 2022-06-04
25
+
26
+
### Fixed
27
+
28
+
+ fixed resolving of protocol-relative target specifier like `//example.com/foo.js`
29
+
30
+
### Deprecated
31
+
32
+
+ use `Buffer` as `options.srcObject` is deprected
33
+
34
+
35
+
36
+
## [0.1.0] - 2022-06-02
37
+
38
+
### Added
39
+
40
+
+ speicifer transforming of import statement, export statement and dynamic import
A plugin to resolve ECMAScript module bare import specifiers at build-time for browsers which don't support import-maps, mostly based on **WICG's [import-maps reference implementation](https://github.com/WICG/import-maps/tree/master/reference-implementation)**.
3
+
A plugin to resolve ECMAScript module bare/url import specifiers at build-time for browsers which don't support import-maps, mostly based on **WICG's [import-maps reference implementation](https://github.com/WICG/import-maps/tree/master/reference-implementation)**.
3. create importmap files like index-dev.importmap
63
+
### Plugin Options
41
64
42
-
```json
65
+
+`srcPath`:string optional
66
+
67
+
file path to importmap
68
+
69
+
+`srcText`:string optional
70
+
71
+
plain text of importmap
72
+
73
+
+`srcObject`:Object optional
74
+
75
+
parsed object of importmap
76
+
77
+
**Note:** One of `srcObject`, `srcText`, `srcPath` should be specified, if multiple of them specified, then precedence order is: srcObject, srcText, srcPath.
78
+
79
+
+`baseDir`: string default `process.cwd()`
80
+
81
+
baseDir to calculate scope paths in order to match scopes defined in importmap
82
+
83
+
+`transformingReport`:string default `undefined`
84
+
85
+
set a file path to save transforming report as a JSON file, will output to Console if value set to `"-"`
86
+
87
+
+`noTransform`:boolean default `false`
88
+
89
+
if value set to `true`, then the plugin will mark specifiers defined in importmap as external, and won't transform those specifiers. useful if you want to build for browsers which already support import-maps and "set external list" with importmap.
+ When tansforming specifiers in [dynamic imports](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import#dynamic_imports), only string literal can be transformed. examples code:
This plugin plays a role of polyfill for browsers but is used at build-time rather than at run-time. If some day (maybe in 2023) all major browsers support import-maps then this plugin can be retired.
206
+
207
+
You may use rollup to build two distributions, for browsers with or without import-maps support, and load corresponding distribution conditionally. e.g.
+ import-maps: [W3C Software and Document License](http://www.w3.org/Consortium/Legal/2015/copyright-software-and-document) and [W3C CLA](https://www.w3.org/community/about/agreements/cla/)
0 commit comments