Skip to content

Instantly share code, notes, and snippets.

@T4rk1n
Created July 25, 2017 00:45
Show Gist options
  • Save T4rk1n/042de528a27dd1e60a70a06c557e74c4 to your computer and use it in GitHub Desktop.
Save T4rk1n/042de528a27dd1e60a70a06c557e74c4 to your computer and use it in GitHub Desktop.
basic webpack config
const path = require('path')
const distFolder = path.resolve(__dirname, 'dist')
const srcFolder = path.resolve(__dirname, 'src')
module.exports = {
entry: ['./src/app.js'],
output: {
filename: 'app.min.js',
path: distFolder
},
devServer: {
contentBase: distFolder,
compress: true,
port: 4040
},
module: {
loaders: [
{
test: /\.jsx?$/,
loader: "babel-loader",
include: path.join(__dirname, "src"),
query: {
presets: ["env", "react"],
plugins: [
"transform-object-rest-spread"
]
}
}
]
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment