Skip to content

Instantly share code, notes, and snippets.

@59naga
Last active June 25, 2018 17:25
Show Gist options
  • Save 59naga/2f205baa3ced672c1d9146deac297f4c to your computer and use it in GitHub Desktop.
Save 59naga/2f205baa3ced672c1d9146deac297f4c to your computer and use it in GitHub Desktop.
{
"presets": [
"env"
],
"plugins": [
["add-module-exports", {"addDefaultProperty": true}]
]
}
---
extends: airbnb

Installation

git clone git@gist.github.com:2f205baa3ced672c1d9146deac297f4c.git issue36
cd issue36

yarn install
npm start

# > babel-node runner
#
# person1: { smile: [Function: smile],
#   greet: [Function: greet],
#   default: [Circular] }
# person2: { smile: [Function: smile],
#   greet: [Function: greet],
#   default: [Circular] }
# person3: { smile: [Function: smile],
#   greet: [Function: greet],
#   default: [Circular] }
import * as person from './person';
export default person;
{
"name": "36",
"version": "1.0.0",
"main": "index.js",
"license": "MIT",
"scripts": {
"start": "babel-node runner"
},
"devDependencies": {
"babel-cli": "^6.26.0",
"babel-core": "^6.26.3",
"babel-plugin-add-module-exports": "^0.3.0-pre",
"babel-preset-env": "^1.7.0",
"eslint": "^4.0.0",
"eslint-config-airbnb": "^17.0.0",
"eslint-plugin-import": "^2.13.0",
"eslint-plugin-jsx-a11y": "^6.0.3",
"eslint-plugin-react": "^7.10.0"
}
}
export const smile = () => {
console.log(":)");
};
export const greet = () => {
console.log("hello");
};
import person1 from './';
var person2 = require('./');
import * as person3 from './person';
console.log("person1:", person1);
console.log("person2:", person2);
console.log("person3:", person3);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment