Skip to content

Instantly share code, notes, and snippets.

@vinicius73
Created May 18, 2017 06:50
Show Gist options
  • Save vinicius73/e79e2498d8b0f3fadb036d46a8c744b6 to your computer and use it in GitHub Desktop.
Save vinicius73/e79e2498d8b0f3fadb036d46a8c744b6 to your computer and use it in GitHub Desktop.
webpack + babel
{
"presets": [
["env", {
"modules": false,
"targets": {
"browsers": "last 2 versions"
}
}],
"stage-2"
],
"plugins": ["transform-runtime"],
"comments": false,
}
module.exports = {
"extends": "standard",
"plugins": [
"standard",
"promise"
],
env: {
node: true
}
};
{
"scripts": {
"build": "webpack",
"dev": "webpack-dev-server"
},
"devDependencies": {
"babel-core": "^6.24.1",
"babel-loader": "^6.4.1",
"babel-preset-env": "^1.4.0",
"eslint": "^3.19.0",
"eslint-config-standard": "^10.2.1",
"eslint-plugin-import": "^2.2.0",
"eslint-plugin-node": "^4.2.2",
"eslint-plugin-promise": "^3.5.0",
"eslint-plugin-standard": "^3.0.1",
"webpack": "^2.4.1",
"webpack-dev-server": "^2.4.2"
},
"dependencies": {
"babel-plugin-transform-runtime": "^6.23.0",
"babel-preset-stage-2": "^6.24.1"
}
}
const path = require('path')
const resolve = value => path.resolve(__dirname, value)
module.exports = {
entry: resolve('src/index.js'),
output: {
filename: 'index.js',
publicPath: '/dist/',
path: resolve('dist/')
},
module: {
rules: [
{
test: /\.js$/,
exclude: /(node_modules|bower_components)/,
use: {
loader: 'babel-loader'
}
}
]
},
devServer: {
hot: false
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment