Skip to content

Instantly share code, notes, and snippets.

@danswater
Last active January 28, 2017 00:01
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danswater/e47b3858965811cb8438a6af6f305e24 to your computer and use it in GitHub Desktop.
Save danswater/e47b3858965811cb8438a6af6f305e24 to your computer and use it in GitHub Desktop.
basic configuration for webpack. also feature babel
module.exports = {
// This is the "main" file which should include all other modules
entry: './src/main.js',
// Where should the compiled file go?
output: {
// To the `dist` folder
path: './dist',
// With the filename `build.js` so it's dist/build.js
filename: 'build.js'
},
module: {
// Special compilation rules
loaders: [
{
// Ask webpack to check: If this file ends with .js, then apply some transforms
test: /\.js$/,
// Transform it with babel
loader: 'babel-loader',
// don't transform node_modules folder (which don't need to be compiled)
exclude: /node_modules/
}
]
}
}
@danswater
Copy link
Author

devdependencies

    "babel-core": "^6.1.2",
    "babel-loader": "^6.1.0",
    "babel-plugin-transform-runtime": "^6.1.2",
    "babel-preset-es2015": "^6.1.2",
    "babel-preset-stage-0": "^6.1.2",
    "babel-runtime": "^5.8.0",
    "webpack": "^1.12.2",

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment