|
Lines 3-10
const { VueLoaderPlugin } = require("vue-loader");
Link Here
|
| 3 |
const path = require("path"); |
3 |
const path = require("path"); |
| 4 |
const rspack = require("@rspack/core"); |
4 |
const rspack = require("@rspack/core"); |
| 5 |
|
5 |
|
| 6 |
module.exports = [ |
6 |
const islandsExport = application => { |
| 7 |
{ |
7 |
const vueDir = |
|
|
8 |
application === "intranet" |
| 9 |
? "intranet-tmpl/prog" |
| 10 |
: "opac-tmpl/bootstrap"; |
| 11 |
|
| 12 |
return { |
| 8 |
resolve: { |
13 |
resolve: { |
| 9 |
alias: { |
14 |
alias: { |
| 10 |
"@fetch": path.resolve( |
15 |
"@fetch": path.resolve( |
|
Lines 15-42
module.exports = [
Link Here
|
| 15 |
__dirname, |
20 |
__dirname, |
| 16 |
"koha-tmpl/intranet-tmpl/prog/js/vue" |
21 |
"koha-tmpl/intranet-tmpl/prog/js/vue" |
| 17 |
), |
22 |
), |
| 18 |
"@cypress": path.resolve(__dirname, "t/cypress"), |
|
|
| 19 |
}, |
23 |
}, |
| 20 |
}, |
24 |
}, |
|
|
25 |
experiments: { |
| 26 |
outputModule: true, |
| 27 |
}, |
| 21 |
entry: { |
28 |
entry: { |
| 22 |
erm: "./koha-tmpl/intranet-tmpl/prog/js/vue/modules/erm.ts", |
|
|
| 23 |
preservation: |
| 24 |
"./koha-tmpl/intranet-tmpl/prog/js/vue/modules/preservation.ts", |
| 25 |
"admin/record_sources": |
| 26 |
"./koha-tmpl/intranet-tmpl/prog/js/vue/modules/admin/record_sources.ts", |
| 27 |
acquisitions: |
| 28 |
"./koha-tmpl/intranet-tmpl/prog/js/vue/modules/acquisitions.ts", |
| 29 |
islands: "./koha-tmpl/intranet-tmpl/prog/js/vue/modules/islands.ts", |
29 |
islands: "./koha-tmpl/intranet-tmpl/prog/js/vue/modules/islands.ts", |
| 30 |
sip2: "./koha-tmpl/intranet-tmpl/prog/js/vue/modules/sip2.ts", |
|
|
| 31 |
}, |
30 |
}, |
| 32 |
output: { |
31 |
output: { |
| 33 |
filename: "[name].js", |
32 |
filename: "[name].esm.js", |
| 34 |
path: path.resolve( |
33 |
path: path.resolve(__dirname, `koha-tmpl/${vueDir}/js/vue/dist/`), |
| 35 |
__dirname, |
34 |
chunkFilename: "[name].[contenthash].esm.js", |
| 36 |
"koha-tmpl/intranet-tmpl/prog/js/vue/dist/" |
|
|
| 37 |
), |
| 38 |
chunkFilename: "[name].[contenthash].js", |
| 39 |
globalObject: "window", |
35 |
globalObject: "window", |
|
|
36 |
library: { |
| 37 |
type: "module", |
| 38 |
}, |
| 40 |
}, |
39 |
}, |
| 41 |
module: { |
40 |
module: { |
| 42 |
rules: [ |
41 |
rules: [ |
|
Lines 46-52
module.exports = [
Link Here
|
| 46 |
options: { |
45 |
options: { |
| 47 |
experimentalInlineMatchResource: true, |
46 |
experimentalInlineMatchResource: true, |
| 48 |
}, |
47 |
}, |
| 49 |
//exclude: [path.resolve(__dirname, "t/cypress/")], |
48 |
exclude: [path.resolve(__dirname, "t/cypress/")], |
| 50 |
}, |
49 |
}, |
| 51 |
{ |
50 |
{ |
| 52 |
test: /\.ts$/, |
51 |
test: /\.ts$/, |
|
Lines 88-94
module.exports = [
Link Here
|
| 88 |
"datatables.net-buttons/js/buttons.print": "DataTable", |
87 |
"datatables.net-buttons/js/buttons.print": "DataTable", |
| 89 |
"datatables.net-buttons/js/buttons.colVis": "DataTable", |
88 |
"datatables.net-buttons/js/buttons.colVis": "DataTable", |
| 90 |
}, |
89 |
}, |
| 91 |
}, |
90 |
}; |
|
|
91 |
}; |
| 92 |
|
| 93 |
module.exports = [ |
| 92 |
{ |
94 |
{ |
| 93 |
resolve: { |
95 |
resolve: { |
| 94 |
alias: { |
96 |
alias: { |
|
Lines 96-120
module.exports = [
Link Here
|
| 96 |
__dirname, |
98 |
__dirname, |
| 97 |
"koha-tmpl/intranet-tmpl/prog/js/fetch" |
99 |
"koha-tmpl/intranet-tmpl/prog/js/fetch" |
| 98 |
), |
100 |
), |
|
|
101 |
"@koha-vue": path.resolve( |
| 102 |
__dirname, |
| 103 |
"koha-tmpl/intranet-tmpl/prog/js/vue" |
| 104 |
), |
| 105 |
"@cypress": path.resolve(__dirname, "t/cypress"), |
| 99 |
}, |
106 |
}, |
| 100 |
}, |
107 |
}, |
| 101 |
experiments: { |
|
|
| 102 |
outputModule: true, |
| 103 |
}, |
| 104 |
entry: { |
108 |
entry: { |
|
|
109 |
erm: "./koha-tmpl/intranet-tmpl/prog/js/vue/modules/erm.ts", |
| 110 |
preservation: |
| 111 |
"./koha-tmpl/intranet-tmpl/prog/js/vue/modules/preservation.ts", |
| 112 |
"admin/record_sources": |
| 113 |
"./koha-tmpl/intranet-tmpl/prog/js/vue/modules/admin/record_sources.ts", |
| 114 |
acquisitions: |
| 115 |
"./koha-tmpl/intranet-tmpl/prog/js/vue/modules/acquisitions.ts", |
| 105 |
islands: "./koha-tmpl/intranet-tmpl/prog/js/vue/modules/islands.ts", |
116 |
islands: "./koha-tmpl/intranet-tmpl/prog/js/vue/modules/islands.ts", |
|
|
117 |
sip2: "./koha-tmpl/intranet-tmpl/prog/js/vue/modules/sip2.ts", |
| 106 |
}, |
118 |
}, |
| 107 |
output: { |
119 |
output: { |
| 108 |
filename: "[name].esm.js", |
120 |
filename: "[name].js", |
| 109 |
path: path.resolve( |
121 |
path: path.resolve( |
| 110 |
__dirname, |
122 |
__dirname, |
| 111 |
"koha-tmpl/intranet-tmpl/prog/js/vue/dist/" |
123 |
"koha-tmpl/intranet-tmpl/prog/js/vue/dist/" |
| 112 |
), |
124 |
), |
| 113 |
chunkFilename: "[name].[contenthash].esm.js", |
125 |
chunkFilename: "[name].[contenthash].js", |
| 114 |
globalObject: "window", |
126 |
globalObject: "window", |
| 115 |
library: { |
|
|
| 116 |
type: "module", |
| 117 |
}, |
| 118 |
}, |
127 |
}, |
| 119 |
module: { |
128 |
module: { |
| 120 |
rules: [ |
129 |
rules: [ |
|
Lines 124-130
module.exports = [
Link Here
|
| 124 |
options: { |
133 |
options: { |
| 125 |
experimentalInlineMatchResource: true, |
134 |
experimentalInlineMatchResource: true, |
| 126 |
}, |
135 |
}, |
| 127 |
exclude: [path.resolve(__dirname, "t/cypress/")], |
136 |
//exclude: [path.resolve(__dirname, "t/cypress/")], |
| 128 |
}, |
137 |
}, |
| 129 |
{ |
138 |
{ |
| 130 |
test: /\.ts$/, |
139 |
test: /\.ts$/, |
|
Lines 167-172
module.exports = [
Link Here
|
| 167 |
"datatables.net-buttons/js/buttons.colVis": "DataTable", |
176 |
"datatables.net-buttons/js/buttons.colVis": "DataTable", |
| 168 |
}, |
177 |
}, |
| 169 |
}, |
178 |
}, |
|
|
179 |
islandsExport("intranet"), |
| 180 |
islandsExport("opac"), |
| 170 |
{ |
181 |
{ |
| 171 |
entry: { |
182 |
entry: { |
| 172 |
"api-client.cjs": |
183 |
"api-client.cjs": |
| 173 |
- |
|
|