Last active
January 28, 2017 00:01
-
-
Save danswater/e47b3858965811cb8438a6af6f305e24 to your computer and use it in GitHub Desktop.
basic configuration for webpack. also feature 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
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/ | |
} | |
] | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
devdependencies