Created
July 30, 2016 17:36
-
-
Save fazibear/7bbd999c27b192d02924057494623b48 to your computer and use it in GitHub Desktop.
This file contains 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
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