Skip to content

Instantly share code, notes, and snippets.

@ali-master
Last active May 30, 2018 01:38
Show Gist options
  • Save ali-master/4cb2b8fd2d586a1652faa0c9d61005ce to your computer and use it in GitHub Desktop.
Save ali-master/4cb2b8fd2d586a1652faa0c9d61005ce to your computer and use it in GitHub Desktop.
A Sample Webpack config file
const path = require('path');
const webpack = require('webpack');
const config = {
entry: "./app/app.js",
output: {
filename: 'app.min.js',
path: './public/static/'
},
devtool: "eval-source-map",
module: {
loaders: [
{
test: /\.(js|jsx)$/,
exclude: /(node_modules|bower_components)/,
loader: 'babel',
query: {
presets: ['es2015', 'react']
}
},
{
test: /\.css$/,
loaders: ["style", "css?modules&localIdentName=[name]---[local]---[hash:base64:5]"]
}
]
},
resolve: {
extensions: ['', '.js', '.jsx']
}
};
module.exports = config;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment