Skip to content

Instantly share code, notes, and snippets.

@dasch88
Last active March 29, 2017 00:30
Show Gist options
  • Save dasch88/e4a6301d718515d496ced4fa8c1ba279 to your computer and use it in GitHub Desktop.
Save dasch88/e4a6301d718515d496ced4fa8c1ba279 to your computer and use it in GitHub Desktop.
Webpack configuration for Aurelia
const path = require('path');
const webpack = require('webpack');
const { AureliaPlugin } = require('aurelia-webpack-plugin');
module.exports = {
context: __dirname + '/src',
entry: { 'main': 'aurelia-bootstrapper' },
output: {
path: path.resolve(__dirname, 'dist'),
publicPath: 'dist',
filename: 'bundle.js',
chunkFilename: 'bundle.js',
sourceMapFilename: 'bundle.js.map'
},
resolve: {
extensions: ['.ts', '.js'],
modules: ['src', 'node_modules', 'Scripts']
},
module: {
rules: [
{ test: /\.less$/i, use: ['style-loader', 'css-loader', 'less-loader'] },
{
test: /\.js$/i,
exclude: /node_modules/,
use: [{
loader: 'babel-loader',
options: {
cacheDirectory: true,
plugins: ['transform-decorators-legacy', 'transform-class-properties'],
presets: ['es2015']
}
}]
},
{ test: /\.html$/i, use: 'html-loader' }
]
},
devtool: 'source-map',
plugins: [
new AureliaPlugin({
includeAll: 'src'
}),
new webpack.ProvidePlugin({
$: 'jquery',
jQuery: 'jquery',
jquery: 'jquery'
})
]
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment