Created
August 9, 2016 20:38
-
-
Save vernondegoede/a2a3a4ab8daa1fec8c5f566eb6318a5a to your computer and use it in GitHub Desktop.
webpack.config.js
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 ExtractTextPlugin = require("extract-text-webpack-plugin"); | |
const path = require('path'); | |
module.exports = { | |
entry: './src/initialize.js', | |
assetsPublicPath: '', | |
output: { | |
path: __dirname + '/www/', | |
filename: 'bundle.js' | |
}, | |
module: { | |
loaders: [ | |
{ | |
test: /\.js?$/, | |
exclude: /node_modules/, | |
loaders: ['babel'] | |
}, | |
{ | |
test: /\.h(andle)?b(ar)?s$/i, | |
loader: 'handlebars' | |
}, | |
{ | |
test: /\.less$/, | |
loader: ExtractTextPlugin.extract("style-loader", "css-loader!less-loader") | |
}, | |
{ | |
test: /\.(jpe?g|png|gif|svg)$/i, | |
loaders: [ | |
'file?hash=sha512&digest=hex&name=[hash].[ext]', | |
'image-webpack?bypassOnDebug&optimizationLevel=7&interlaced=false' | |
] | |
} | |
] | |
}, | |
plugins: [ | |
new ExtractTextPlugin("style.css", { | |
allChunks: true | |
}) | |
], | |
devServer: { | |
port: 3000, | |
historyApiFallback: true | |
}, | |
devtool: "#inline-source-map" | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment