1.0.1 • Published 8 years ago

babel-plugin-transform-import-scripts-resolve v1.0.1

Weekly downloads
4
License
ISC
Repository
gitlab
Last release
8 years ago

babel-plugin-transform-import-scripts-resolve

Map named dependencies to relative paths for importScripts calls in Service Worker scripts.

Usage

.babelrc

{
  "plugins": [
    ["transform-import-resolve", {
      "sourceToDestination": {
        "/some/absolute/foo.js": "/some/absolute/bar.js"
      },
      "outputDirectory": "/public"
    }]
  ]
}

In

importScripts('./foo.js')

Out

importScripts('./bar.js')

Options

sourceToDestination

Type: Function or Object or Map

Maps the absolute path of a dependency to another path.

outputDirectory

Output directory to which the mapped path will be made relative.

1.0.1

8 years ago

1.0.0

8 years ago