Last active
June 13, 2017 07:39
-
-
Save kkeeth/a9e93d131a4a01325cd7b2c7be306a36 to your computer and use it in GitHub Desktop.
ES6(ES2015)用のサンプル集
This file contains hidden or 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
/** gulpの設定例 **/ | |
const gulp = require("gulp"), | |
buble = require("gulp-buble") | |
gulp.task('buble', () => { | |
gulp.src('./es6/*.js') | |
.pipe(buble()) | |
.pipe(gulp.dest('./js/')) | |
}); | |
gulp.task('watch', () => { | |
gulp.watch('./es6/*.js', ['buble']) | |
}); | |
gulp.task('default', ['buble', 'watch']); |
This file contains hidden or 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 buble from 'rollup-plugin-buble' | |
import commonjs from 'rollup-plugin-commonjs' | |
// 必要があればコメントアウトを外す | |
// import node_resolve from 'rollup-plugin-node-resolve' | |
// import multi_entry from 'rollup-plugin-multi-entry' | |
export default { | |
entry: 'src/app.js', | |
dest: 'build/bundle.js', | |
format: 'es', | |
// 必要があればコメントアウトを外す | |
// sourceMap: true, | |
plugins: [ | |
// 必要があればコメントアウトを外す | |
// node_resolve({ jsnext: true }), | |
// multi_entry(), | |
commonjs(), | |
buble() | |
] | |
} |
This file contains hidden or 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
/** webpackの設定例 **/ | |
const path = require('path'), | |
webpack = require('webpack'), | |
glob = require('glob') | |
module.exports = [ | |
{ | |
entry: glob.sync('./es6/*.js'), | |
output: { | |
path: path.resolve(__dirname + '/build/'), | |
filename: 'bundle.js' | |
}, | |
module: { | |
rules: [ | |
{ | |
test: /\.js$/, | |
enforce: 'post', | |
exclude: /node_modules/, | |
loader: 'buble-loader' | |
} | |
] | |
} | |
} | |
] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment