Skip to content

Instantly share code, notes, and snippets.

@hew
Last active May 16, 2017 01:14
Show Gist options
  • Select an option

  • Save hew/92c22a9fc0f367a9ae6ba7ff73e9703a to your computer and use it in GitHub Desktop.

Select an option

Save hew/92c22a9fc0f367a9ae6ba7ff73e9703a to your computer and use it in GitHub Desktop.
Babel Rollup Boilerplate

Simple Config for Rollup

{
"presets": [
["env", {
"targets": {
"browsers": ["last 2 versions", "safari >= 7"]
},
"modules": false
}]
],
"plugins": [
"external-helpers"
]
}
{
"scripts": {
"build": "babel ./js/main.js -o ./js/main.bundle.js"
},
"dependencies": {
"babel-cli": "^6.24.1",
"jump.js": "^1.0.2",
"mojs": "^0.2.0"
},
"devDependencies": {
"babel-cli": "^6.24.1",
"babel-plugin-external-helpers": "^6.22.0",
"babel-preset-env": "^1.4.0",
"babel-preset-stage-1": "^6.24.1",
"rollup": "^0.41.6",
"rollup-plugin-babel": "^2.7.1",
"rollup-plugin-node-resolve": "^3.0.0"
}
}
import resolve from 'rollup-plugin-node-resolve';
import babel from 'rollup-plugin-babel';
export default {
entry: 'js/main.js',
format: 'es',
plugins: [
resolve(),
babel({
exclude: 'node_modules/**' // only transpile our source code
})
],
dest: './js/main.bundle.js'
}
console.log('BUILT! 😈');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment