forked from ome/omero-iviewer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.prod.config.js
57 lines (56 loc) · 1.48 KB
/
webpack.prod.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
const path = require('path');
const {AureliaPlugin} = require('aurelia-webpack-plugin');
const ProvidePlugin = require('webpack/lib/ProvidePlugin');
module.exports = {
entry: {
main: './src/main',
deps: ['d3', 'file-saver', 'text-encoding']
},
output: {
path: path.join(__dirname, 'build'),
filename: "[name].js"
},
optimization: {
splitChunks: {
cacheGroups: {
commons: {
test: /[\\/]node_modules[\\/]/,
name: 'vendors',
chunks: 'all'
}
}
},
},
performance: {
hints: false
},
plugins: [
new AureliaPlugin({
aureliaApp: undefined,
aureliaConfig: "basic",
features: {svg: false}
}),
new ProvidePlugin({
Promise: 'bluebird',
$: 'jquery',
jQuery: 'jquery',
'window.jQuery': 'jquery'
})],
resolve: {
extensions: [".js"],
modules: ["src", "libs", "node_modules"]
},
module: {
rules: [
{ test: /\.js$/, use: {loader: 'babel-loader'}},
{ test: require.resolve('jquery'), use: {
loader: 'expose-loader',
options: {exposes: ["$", "jQuery"]}
}},
{ test: /\.(png|gif|jpg|jpeg)$/, use: {loader: 'file-loader?name=css/images/[name].[ext]' }},
{ test: /\.(woff|woff2)$/, use: {loader: 'file-loader?name=css/fonts/[name].[ext]' }},
{ test: /\.css?$/, use: {loader: 'file-loader?name=css/[name].[ext]' }},
{ test: /\.html$/, use: {loader: 'html-loader' }}
]
}
};