Releases: stealjs/steal
2.3.0
importRewrites
is a new feature in steal config. It is similar tomap
with these differences:- it is always scoped to an npm package
- it does a straight text replacement of imports prior to normalizing
Here's a practical example: given an old jQueryUI widget, which we'll call this-old-jquery-ui-plugin
, has a file that references an old jQueryUI naming convention for the widget library:
if (typeof define === 'function' && define.amd) {
// Register as an anonymous AMD module:
define([
'jquery',
'jquery.ui.widget'
], factory);
}
However, we are using a jquery-ui version that has been published with a different file structure, and jquery.ui.widget.js
is no longer a valid file path. We want that import to point to the prior-to-normalized path jquery-ui/ui/widget.js
instead. To do this, add the following to the steal
section in package.json
:
"importRewrites": {
"this-old-jquery-ui-plugin": {
"jquery.ui.widget": "jquery-ui/ui/widget"
}
}
With this config, all of the imports of jquery.ui.widget
in this npm package will be renamed to jquery-ui/ui/widget
and then normalized to e.g. [email protected]#ui/widget
.
Note that wildcards are not supported in importRewrites
; only exact string matches of import specifiers will be replaced.
PR: #1522
Also in this release:
2.2.4
2.2.3
Add support for packages with a main
that should resolve to index.js
This patch release fixes an issue with packages using a trailing slash in its main like:
{
"name": "a-package",
"version": "1.0.0",
"main": "lib/"
}
in this case, steal should resolve main to lib/index
.
2.2.2
Adds documentation on steal.loader.env
v2.2.1 2.2.1
Introduce forceES5 flag to skip ES2015 transpilation
{
"steal": {
"forceES5": false // defaults to true
}
}
when set to false, Steal.js does not include the ES2015 preset. This is useful when the target browser supports all of the syntax/features transpiled by the ES2015 preset.
If a package is missing, warn which file imported it.
This enhances the warning in the console by adding which file tries to import a missing package like is showing in the following screenshot: