Skip to content

Instantly share code, notes, and snippets.

@rjmacarthy
Last active July 27, 2016 13:52
Show Gist options
  • Save rjmacarthy/f516481d5d5accd3c499bae67d9b1e3d to your computer and use it in GitHub Desktop.
Save rjmacarthy/f516481d5d5accd3c499bae67d9b1e3d to your computer and use it in GitHub Desktop.
Es6 Starter - webpack | babel and package.json
<html>
<head>
<title></title>
</head>
<body>
<script src="bundle.js"></script>
</body>
</html>
npm install webpack babel-core babel-eslint babel-loader babel-preset-es2015 babel-register --save
{
// See https://go.microsoft.com/fwlink/?LinkId=759670
// for the documentation about the jsconfig.json format
"compilerOptions": {
"target": "es6",
"module": "commonjs",
"allowSyntheticDefaultImports": true
},
"exclude": [
"node_modules",
"bower_components",
"jspm_packages",
"tmp",
"temp"
]
}
{
"name": "babs",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"dev": "webpack-dev-server --config webpack.config.js",
"build": "webpack --config webpack.config.js"
},
"author": "someone",
"license": "ISC",
"dependencies": {
"babel-preset-es2015": "^6.5.0",
"chai": "^3.5.0",
"faker": "^3.1.0",
"html-webpack-plugin": "^2.8.2",
"jquery": "^2.2.0",
"lodash": "^4.4.0",
"mocha": "^2.4.5",
"superagent": "^1.7.2",
"supertest": "^1.2.0",
"webpack": "^1.12.13",
"webpack-dev-server": "^1.14.1"
},
"devDependencies": {
"babel-core": "^6.5.2",
"babel-loader": "^6.2.2"
}
}
var path = require('path');
var webpack = require('webpack');
module.exports = {
devtool: 'source-map',
entry: './index.js',
output: { path: __dirname, filename: 'bundle.js' },
module: {
loaders: [{
test: /.js?$/,
loader: 'babel-loader',
exclude: /node_modules/,
query: {
presets: ['es2015']
}
}]
},
plugins: [
new webpack.optimize.UglifyJsPlugin({ minimize: true })
]
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment