UNPKG

1.24 kBTypeScriptView Raw
1/**
2 * @license
3 * Copyright (c) 2018 The Polymer Project Authors. All rights reserved.
4 * This code may only be used under the BSD style license found at
5 * http://polymer.github.io/LICENSE.txt
6 * The complete set of authors may be found at
7 * http://polymer.github.io/AUTHORS.txt
8 * The complete set of contributors may be found at
9 * http://polymer.github.io/CONTRIBUTORS.txt
10 * Code distributed by Google as part of the polymer project is also
11 * subject to an additional IP rights grant found at
12 * http://polymer.github.io/PATENTS.txt
13 */
14import { NodePath } from '@babel/traverse';
15import { Program } from '@babel/types';
16/**
17 * Rewrites `import.meta`[1] into an import for a module named "meta". It is
18 * expected this plugin runs alongside @babel/plugin-transform-modules-amd which
19 * will transform this import into an AMD dependency, and is loaded using
20 * @polymer/esm-amd-loader which will provide an object with a `url`[2] property
21 * for the "meta" dependency.
22 *
23 * [1]: https://github.com/tc39/proposal-import-meta
24 * [2]: https://html.spec.whatwg.org/#hostgetimportmetaproperties
25 */
26export declare const rewriteImportMeta: {
27 inherits: any;
28 visitor: {
29 Program(path: NodePath<Program>): void;
30 };
31};