Created
August 8, 2016 13:07
-
-
Save rquast/53d64814dffd7d7035f77e3ecee07621 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 webpack = require('webpack'); | |
var AureliaWebpackPlugin = require('aurelia-webpack-plugin'); | |
var ProvidePlugin = require('webpack/lib/ProvidePlugin'); | |
module.exports = { | |
context: __dirname, | |
devServer: { | |
host: 'localhost', | |
port: 9000 | |
}, | |
entry: { | |
main: [ | |
'./src/main' | |
] | |
}, | |
output: { | |
path: path.join(__dirname, 'build'), | |
filename: 'bundle.js' | |
}, | |
node: { | |
fs: "empty" | |
}, | |
plugins: [ | |
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 | |
}) | |
], | |
resolve: { | |
root: [ | |
path.resolve('./') | |
] | |
}, | |
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