var path = require('path');
var htmWebpackPlugin = require('html-webpack-plugin');
var webpack = require('webpack');
module.exports={
context: __dirname,
entry: './src/app.js',
output:{
path: path.resolve(__dirname,'dist'),
filename: 'js/[name].bundle.js'
},
module: {
loaders: [
{
test: /\.js$/,
loader: 'babel-loader',
exclude: __dirname+'./node_modules',
include: __dirname+'./src/',
options: {
'presets': ['latest']
}
},
{
test: /\.css$/,
use: [
{
loader: 'style-loader'
},
{
loader: 'css-loader',
options: {
importLoaders:1
}
},
{
loader: 'postcss-loader'
}
]
}
]
},
plugins: [
new htmWebpackPlugin({
filename: 'index.html',
template: 'index.html',
inject: 'body'
}),
new webpack.LoaderOptionsPlugin({
options: {
postcss: function(){
return [
require('autoprefixer')({
broswers: ['last 5 versions']
})
]
}
}
})
]
}