Last active
August 29, 2015 14:10
-
-
Save aackerman/637aef98fb0f6ba981d4 to your computer and use it in GitHub Desktop.
ES6 modules with webpack and 6to5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export default function add(...args){ | |
return args.reduce( (a,b) => a + b, 0 ) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import add from './add.js' | |
console.log(add(1,3,4,5)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "gist", | |
"version": "0.0.0", | |
"description": "", | |
"main": "main.js", | |
"scripts": { | |
"test": "echo \"Error: no test specified\" && exit 1", | |
"js": "webpack && node bundle.js" | |
}, | |
"author": "", | |
"license": "ISC", | |
"devDependencies": { | |
"6to5": "^1.14.17", | |
"6to5-loader": "^0.2.3", | |
"webpack": "^1.4.13" | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = { | |
entry: './main.js', | |
output: { | |
filename: './bundle.js' | |
}, | |
module: { | |
loaders: [ | |
{ test: /\.js/, loader: '6to5-loader' } | |
] | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment