Skip to content

Instantly share code, notes, and snippets.

@AlbertoDePena
Last active April 9, 2018 14:10
Show Gist options
  • Save AlbertoDePena/2f23308d63d082aaf561c1b07e7ecd6f to your computer and use it in GitHub Desktop.
Save AlbertoDePena/2f23308d63d082aaf561c1b07e7ecd6f to your computer and use it in GitHub Desktop.
Single bundle aurelia webpack
'use strict';
const path = require('path');
const Webpack = require('webpack');
const { AureliaPlugin } = require('aurelia-webpack-plugin');
const resolve = filePath => path.resolve(__dirname, filePath);
module.exports = {
entry: {
bundle: resolve('./node_modules/aurelia-bootstrapper')
},
output: {
path: resolve('./dist'),
publicPath: '/',
filename: '[name].js?v=[chunkhash]'
},
resolve: {
extensions: ['.ts', '.js'],
modules: ['src', 'node_modules'].map(x => path.resolve(x))
},
module: {
rules: [
{ test: /\.ts$/i, use: 'ts-loader' },
{ test: /\.html$/i, use: 'html-loader' },
{ test: /\.css$/i, loader: 'css-loader', issuer: /\.html?$/i },
{
test: /\.css$/i,
loader: ['style-loader', 'css-loader'],
issuer: /\.[tj]s$/i
},
{
test: /.(ttf|eot|svg|otf|woff)(\?v=[0-9]\.[0-9]\.[0-9])?$/,
use: [
{
loader: 'file-loader',
options: {
name: '[name].[ext]',
outputPath: 'fonts/',
publicPath: 'dist/fonts'
}
}
]
}
]
},
plugins: [
new AureliaPlugin({
features: {
svg: false
}
}),
new Webpack.ProvidePlugin({
Promise: 'bluebird'
}),
new CopyWebpackPlugin([
{
from: 'src/splash.css'
}
])
]
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment