Skip to content

Instantly share code, notes, and snippets.

@fazibear
Created July 30, 2016 17:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fazibear/7bbd999c27b192d02924057494623b48 to your computer and use it in GitHub Desktop.
Save fazibear/7bbd999c27b192d02924057494623b48 to your computer and use it in GitHub Desktop.
const webpack = require('webpack');
const path = require('path');
const appDir = path.join(__dirname, './app');
const distDir = path.join(__dirname, './dist');
module.exports = {
context: appDir,
entry: [
'./index.js',
'./index.html',
'./styles/main.sass'
],
output: {
path: distDir,
filename: 'bundle.js'
},
module: {
loaders: [
{
test: /\.html$/,
loader: 'file',
query: {
name: '[name].[ext]'
}
},
{
test: /\.(sass|scss)$/,
loaders: ["style", "css", "sass"]
},
{
test: /\.(js|jsx)$/,
exclude: /node_modules/,
loaders: 'babel-loader',
query: {
presets: ["es2015-native-modules", "react"],
plugins: ["transform-class-properties"],
"env": {
"development": {
"presets": ["react-hmre"]
}
}
}
},
],
},
resolve: {
modules: [
appDir,
'node_modules'
]
},
plugins: [
new webpack.HotModuleReplacementPlugin()
],
devServer: {
contentBase: appDir,
hot: true,
inline: true
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment