Created
May 18, 2017 06:50
-
-
Save vinicius73/e79e2498d8b0f3fadb036d46a8c744b6 to your computer and use it in GitHub Desktop.
webpack + babel
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
Show hidden characters
{ | |
"presets": [ | |
["env", { | |
"modules": false, | |
"targets": { | |
"browsers": "last 2 versions" | |
} | |
}], | |
"stage-2" | |
], | |
"plugins": ["transform-runtime"], | |
"comments": false, | |
} |
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
module.exports = { | |
"extends": "standard", | |
"plugins": [ | |
"standard", | |
"promise" | |
], | |
env: { | |
node: true | |
} | |
}; |
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
{ | |
"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" | |
} | |
} |
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
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