babel-plugin-transform-import-scripts-resolve
1.0.1 • Public • Published 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.
/babel-plugin-transform-import-scripts-resolve/
//
Package Sidebar
Install
npm i babel-plugin-transform-import-scripts-resolve
Weekly Downloads