Steal Versions Save

Gets JavaScript

v2.3.0

1 year ago
  • importRewrites is a new feature in steal config. It is similar to map 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: https://github.com/stealjs/steal/pull/1522 Also in this release:

v2.2.4

4 years ago

Fixes ES module detection when there are comments within strings and single line minified modules.

v2.2.3

4 years ago

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.

v2.2.2

4 years ago

Stricter System.register detection

This patch release fixes #1500:

require("fs.js");
FileSystem.registerFileSystem();

Steal.js would not detect this module as CommonJS because line 2 would be matched by the System.register extension regular expression.

Thanks @kayahr for reporting the issue.

v2.2.1

5 years ago

v2.2.0

5 years ago
{
   "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.

v2.1.14

5 years ago

This enhances the warning in the console by adding which file tries to import a missing package like is showing in the following screenshot:

foo

#1463

v2.1.13

5 years ago

Fixes an issue where a module loading a dependency by its exact npm module name might load the wrong package version and error out.

v2.1.12

5 years ago

This is a patch release, which adds names to all of the extension functions to make them easier to debug.

v2.1.10

5 years ago

This fixes a false positive JSON parse warning in production when a JSON module is loaded from another bundle.