Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marcingolenia/2fa78ed2cd42f9294da5edd22d351245 to your computer and use it in GitHub Desktop.
Save marcingolenia/2fa78ed2cd42f9294da5edd22d351245 to your computer and use it in GitHub Desktop.
/*eslint-disable no-var*/
var path = require('path');
var AureliaWebpackPlugin = require('aurelia-webpack-plugin');
var ProvidePlugin = require('webpack/lib/ProvidePlugin');
module.exports = {
resolve: {
extensions: ['', '.js', '.ts']
},
output: {
path: path.join(__dirname, 'build'),
filename: 'bundle.js'
},
resolve: {
alias: {
jquery: path.resolve(__dirname, 'node_modules', 'jquery', 'dist', 'jquery.js')
}
},
devServer: {
host: 'localhost',
port: 3000
},
entry: {
main: [
'./src/main'
]
},
node: {
fs: "empty"
},
plugins: [
new AureliaWebpackPlugin({
includeSubmodules:[
]
}),
new ProvidePlugin(
{
Promise: 'bluebird',
$: "jquery",
jQuery: "jquery",
"window.jQuery": "jquery", // this doesn't expose jQuery property for window, but expose it to every module
}
)
],
module: {
loaders: [
{ test: /\.ts$/, loader: 'ts-loader' },
{ test: /\jquery.dataTables.js/, loader: 'imports?define=>false'},
{ test: /\.css?$/, loader: 'style!css'},
{ test: /\.html$/, loader: 'raw' },
{ test: /\.(png|gif|jpg)$/, loader: 'url-loader?limit=8192' },
{ test: /\.woff2(\?v=[0-9]\.[0-9]\.[0-9])?$/, loader: 'url-loader?limit=10000&mimetype=application/font-woff2' },
{ test: /\.woff(\?v=[0-9]\.[0-9]\.[0-9])?$/, loader: 'url-loader?limit=10000&mimetype=application/font-woff' },
{ test: /\.(ttf|eot|svg)(\?v=[0-9]\.[0-9]\.[0-9])?$/, loader: 'file-loader' }
]
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment