defaultMember
already is an alias – it doesn’t need to be the name of the exported function/thing. Just do
import alias from 'my-module';
Alternatively you can do
import {default as alias} from 'my-module';
but that’s rather esoteric.
More Related Contents:
- Is it possible to import modules from all files in a directory, using a wildcard?
- Pass options to ES6 module imports
- `export const` vs. `export default` in ES6
- Node.js plans to support import/export ES6 (ECMAScript 2015) modules
- using brackets with javascript import syntax
- ES6 Modules: Undefined onclick function after import
- ES2015 import doesn’t work (even at top-level) in Firefox
- Which browsers support import and export syntax for ECMAScript 6?
- ES6 modules in the browser: Uncaught SyntaxError: Unexpected token import
- ES6: import module from URL
- ES6 Destructuring and Module imports
- Is using an ES6 import to load specific names faster than importing a namespace?
- Javascript ES6 export const vs export let
- ES6 module Import giving “Uncaught SyntaxError: Unexpected identifier”
- Are ES6 module imports hoisted?
- Not recommended to use “use strict” in ES6?
- Inlining ECMAScript Modules in HTML
- What is the defined execution order of ES6 imports?
- What is the difference between importing a function expression or a function declaration from a ES6 module?
- How will browsers handle ES6 import/export syntax
- ES2015 “import” not working in node v6.0.0 with with –harmony_modules option
- Re-export default in ES 6 modules
- Output an ES module using webpack
- How does JavaScript import find the module without an extension?
- How to destructure into dynamically named variables in ES6?
- ECMAScript 2015: const in for loops
- ECMAScript 6 class destructor
- Promises, pass additional parameters to then chain
- String interpolation on variable
- Why will ES6 WeakMap’s not be enumerable?