Skip to content

Instantly share code, notes, and snippets.

@stoffeastrom
Created January 5, 2017 21:14
Show Gist options
  • Save stoffeastrom/c7234b3e67d81d982c590c34192eb6e3 to your computer and use it in GitHub Desktop.
Save stoffeastrom/c7234b3e67d81d982c590c34192eb6e3 to your computer and use it in GitHub Desktop.
webpack config
module.exports = {
devServer: {
host: '0.0.0.0',
port: 9000
},
entry: {
'app': ['aurelia-bootstrapper-webpack', 'aurelia-polyfills', 'aurelia-pal', 'aurelia-pal-browser', 'bluebird', main]
},
output: {
path: outDir + '/' + pkg.version,
filename: '[name]_[hash].bundle.js'
},
plugins: [
new AureliaWebpackPlugin({
root: root,
src: srcDir
}),
new HtmlWebpackPlugin({
favicon: 'favicon.ico',
template: 'index.html',
inject: 'body'
}),
extractCSS,
new DefinePlugin({
CLIENT_VERSION: JSON.stringify(pkg.version)
})
],
resolve: {
extensions: ['.js', '.ts', '.css']
},
module: {
rules: [
{ test: /\.ts$/, use: [{ loader: 'awesome-typescript-loader' }] },
{ test: /\.html$/, use: [{ loader: 'raw-loader' }] },
{ test: /\.css$/i, loader: extractCSS.extract({
fallbackLoader: 'style-loader',
loader: [
{ loader: 'css-loader', options: { importLoaders: 1 } },
'postcss-loader'
]
})
}
]
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment