forked from AtlasOfLivingAustralia/ecodata
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
89 lines (84 loc) · 2.39 KB
/
webpack.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
const path = require('path');
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
module.exports = {
mode: 'production',
entry: {
// tools: {
// import:'./src/main/webapp/js/tools.js',
// dependOn: 'vendor'
// },
// score: {
// import:'./src/main/webapp/js/score.js',
// dependOn: 'vendor',
// library: {
// type:'assign',
// name:'Ecodata'
// }
// },
vendor:[
'jquery',
'knockout',
'jsoneditor',
'bootstrap',
'bootstrap-datepicker',
'./src/main/webapp/vendor/jquery-validation-engine/jquery.validationEngine.js',
'./src/main/webapp/vendor/jquery-validation-engine/jquery.validationEngine-en.js',
'knockout-mapping',
'knockout-sortable',
'jquery-ui',
'lodash',
'select2'
],
ecodata:'./src/main/webapp/css/ecodata.css'
},
devtool: 'inline-source-map',
output: {
path: path.join(__dirname, 'grails-app/assets/dist/'),
publicPath: '/assets/',
filename: 'bundle-[name].js',
assetModuleFilename: '[name][ext]',
clean: true,
},
optimization: {
runtimeChunk: 'single'
},
module: {
rules: [
{
test: /\.css$/,
use: [MiniCssExtractPlugin.loader,
"css-loader"
]
},
{
test: /\.(jpe?g|png|gif|svg|eot|woff|woff2|ttf)$/i,
type:'asset/resource'
},
{
test: require.resolve("jquery"),
loader: "expose-loader",
options: {
exposes: ["$", "jQuery"]
},
},
{
test: require.resolve("knockout"),
loader: "expose-loader",
options: {
exposes: ["ko"]
},
},
{
test: require.resolve("jsoneditor"),
loader: "expose-loader",
options: {
exposes: ["JSONEditor"]
},
},
]
},
plugins: [
new MiniCssExtractPlugin({filename:'[name].css'}),
],
target: ['web', 'es5']
};