Created
August 8, 2016 13:08
-
-
Save rquast/6a310a75a9b868a5c42dc988c24b2e9d to your computer and use it in GitHub Desktop.
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
/*eslint-disable no-var*/ | |
var path = require('path'); | |
var HtmlWebpackPlugin = require('html-webpack-plugin'); | |
var AureliaWebpackPlugin = require('aurelia-webpack-plugin'); | |
var ProvidePlugin = require('webpack/lib/ProvidePlugin'); | |
var FaviconsWebpackPlugin = require('favicons-webpack-plugin'); | |
var pkg = require('./package.json'); | |
var outputFileTemplateSuffix = '-' + pkg.version; | |
module.exports = { | |
entry: { | |
main: [ | |
'./src/main' | |
] | |
}, | |
output: { | |
path: path.join(__dirname, 'dist'), | |
filename: '[name]' + outputFileTemplateSuffix + '.js', | |
chunkFilename: '[id]' + outputFileTemplateSuffix + '.js' | |
}, | |
node: { | |
fs: "empty" | |
}, | |
plugins: [ | |
new FaviconsWebpackPlugin('./cavy-logo.png'), | |
new HtmlWebpackPlugin({ | |
title: 'Cavy Client - ' + pkg.version, | |
template: 'index.prod.html', | |
filename: 'index.html' | |
}), | |
new ProvidePlugin({ | |
Promise: 'bluebird', | |
$: 'jquery', | |
jQuery: 'jquery', | |
'window.jQuery': 'jquery' // this doesn't expose jQuery property for window, but expose it to every module | |
}), | |
new AureliaWebpackPlugin({ | |
nameExternalModules: false | |
}) | |
], | |
module: { | |
loaders: [ | |
{ test: /\.json$/, loader: 'json-loader'}, | |
{ test: /\.js$/, loader: 'babel', exclude: /node_modules/, query: { presets: ['es2015-loose', 'stage-1'], plugins: ['transform-decorators-legacy'] } }, | |
{ test: /\.html$/, loader: 'html' }, | |
{ test: /\.(png|gif|jpg)$/, loader: 'url?limit=8192' }, | |
{ test: /\.woff2(\?v=[0-9]\.[0-9]\.[0-9])?$/, loader: 'url?limit=10000&mimetype=application/font-woff2' }, | |
{ test: /\.woff(\?v=[0-9]\.[0-9]\.[0-9])?$/, loader: 'url?limit=10000&mimetype=application/font-woff' }, | |
{ test: /\.(ttf|eot|svg)(\?v=[0-9]\.[0-9]\.[0-9])?$/, loader: 'file' }, | |
{ test: /\.css$/, loader: 'raw' } | |
] | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment