Created
January 5, 2017 21:14
-
-
Save stoffeastrom/c7234b3e67d81d982c590c34192eb6e3 to your computer and use it in GitHub Desktop.
webpack config
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
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