-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathModules.js
More file actions
39 lines (31 loc) · 1.2 KB
/
Copy pathModules.js
File metadata and controls
39 lines (31 loc) · 1.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
"use strict";
//------------------------------------------------------------------------------
// Value Export/Import
// Support for exporting/importing values from/to modules without global namespace pollution.
// http://es6-features.org/#ValueExportImport
//------------------------------------------------------------------------------
// lib/math.js
export function sum (x, y) { return x + y }
export var pi = 3.141593
// someApp.js
import * as math from "lib/math"
console.log("2π = " + math.sum(math.pi, math.pi))
// otherApp.js
import { sum, pi } from "lib/math"
console.log("2π = " + sum(pi, pi))
//------------------------------------------------------------------------------
// Default & Wildcard
// Marking a value as the default exported value and mass-mixin of values.
// http://es6-features.org/#DefaultWildcard
//------------------------------------------------------------------------------
// lib/mathplusplus.js
export * from "lib/math"
export var e = 2.71828182846
export default (x) => Math.exp(x)
// someApp.js
import exp, { pi, e } from "lib/mathplusplus"
console.log("e^{π} = " + exp(pi))
export {};
import a,{aaa as bbb} from 'ccc';
import('runtime_import');
import React from 'react';