Skip to content

Instantly share code, notes, and snippets.

@bceskavich
Created October 6, 2015 03:00
Show Gist options
  • Save bceskavich/19146aa80868a4ee9c9b to your computer and use it in GitHub Desktop.
Save bceskavich/19146aa80868a4ee9c9b to your computer and use it in GitHub Desktop.
config/webpack.base.js
// config/webpack.base.js
var path = require(‘path’);
var config = require(‘config’);
var webpack = require(‘webpack’);
var HtmlWebpackPlugin = require(‘html-webpack-plugin’);
module.exports = {
cache: true,
output: {
path: config.get(‘webpack.output.path’),
publicPath: ‘/assets/’,
filename: ‘app.[hash].js’,
},
module: {
loaders: [
{
test: /\.(jpe?g|png|gif|svg|ico|pdf)$/i,
loader: ‘url-loader?limit=8192’
}
]
},
plugins: [
new webpack.NoErrorsPlugin(),
new HtmlWebpackPlugin({
env: config.get(‘env’),
filename: config.get(‘webpack.output.htmlPath’),
template: ‘src/templates/index.html’
}),
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment