Skip to content

Instantly share code, notes, and snippets.

@mischkl
Created November 22, 2016 15:21
Show Gist options
  • Save mischkl/cf7ab4b10df9763aa698a5b885f700cd to your computer and use it in GitHub Desktop.
Save mischkl/cf7ab4b10df9763aa698a5b885f700cd to your computer and use it in GitHub Desktop.
module.exports = {
entry: {
index: './app/index'
},
output: {
path: __dirname + '/dist',
filename: '[name]-[hash].js'
},
resolve: {
extensions: ['.js', '.ts'],
modules: ['node_modules']
},
module: {
loaders: [
{
test: /\.ts$/,
exclude: /node_modules/,
loader: 'awesome-typescript-loader'
},
{
test: /\.json$/,
loader: 'raw-loader'
},
{
test: /\.html$/,
loader: 'html-loader?removeRedundantAttributes=false'
},
{
test: /\.scss$/,
loader: 'style-loader!css-loader?sourceMap!postcss-loader!resolve-url-loader!sass-loader?sourceMap'
},
{
test: /\.(png|jpg)$/,
loader: 'url-loader'
},
{
test: /\.(eot|woff|woff2|ttf)$/,
loader: 'url-loader'
}
]
},
node: {
__filename: true
},
plugins: [
webpackFailPlugin,
new webpack.ProvidePlugin({
'_': 'lodash',
$: 'jquery',
jQuery: 'jquery',
'window.jQuery': 'jquery',
moment: 'moment'
}),
new HtmlWebpackPlugin({
inject: false,
template: './app/index.ejs'
}),
new webpack.LoaderOptionsPlugin({
postcss: function () {
return [
autoprefixer({
browsers: ['last 1 version']
})
];
}
})
],
devServer: {
contentBase: './dist',
historyApiFallback: true,
host: 'localhost',
port: 9000,
stats: {
chunks: false
}
},
devtool: 'cheap-module-inline-source-map'
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment