Skip to content

Instantly share code, notes, and snippets.

@vernondegoede
Created August 9, 2016 20:38
Show Gist options
  • Save vernondegoede/a2a3a4ab8daa1fec8c5f566eb6318a5a to your computer and use it in GitHub Desktop.
Save vernondegoede/a2a3a4ab8daa1fec8c5f566eb6318a5a to your computer and use it in GitHub Desktop.
webpack.config.js
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