|
Lines 3-94
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 |
module.exports = [ |
| 7 |
experiments: { |
7 |
{ |
| 8 |
css: true, |
8 |
experiments: { |
| 9 |
}, |
9 |
css: true, |
| 10 |
entry: { |
10 |
}, |
| 11 |
erm: "./koha-tmpl/intranet-tmpl/prog/js/vue/modules/erm.ts", |
11 |
entry: { |
| 12 |
preservation: |
12 |
erm: "./koha-tmpl/intranet-tmpl/prog/js/vue/modules/erm.ts", |
| 13 |
"./koha-tmpl/intranet-tmpl/prog/js/vue/modules/preservation.ts", |
13 |
preservation: |
| 14 |
"admin/record_sources": |
14 |
"./koha-tmpl/intranet-tmpl/prog/js/vue/modules/preservation.ts", |
| 15 |
"./koha-tmpl/intranet-tmpl/prog/js/vue/modules/admin/record_sources.ts", |
15 |
"admin/record_sources": |
| 16 |
islands: "./koha-tmpl/intranet-tmpl/prog/js/vue/modules/islands.ts", |
16 |
"./koha-tmpl/intranet-tmpl/prog/js/vue/modules/admin/record_sources.ts", |
| 17 |
}, |
17 |
islands: "./koha-tmpl/intranet-tmpl/prog/js/vue/modules/islands.ts", |
| 18 |
output: { |
18 |
}, |
| 19 |
filename: "[name].js", |
19 |
output: { |
| 20 |
path: path.resolve( |
20 |
filename: "[name].js", |
| 21 |
__dirname, |
21 |
path: path.resolve( |
| 22 |
"koha-tmpl/intranet-tmpl/prog/js/vue/dist/" |
22 |
__dirname, |
| 23 |
), |
23 |
"koha-tmpl/intranet-tmpl/prog/js/vue/dist/" |
| 24 |
chunkFilename: "[name].[contenthash].js", |
24 |
), |
| 25 |
globalObject: "window", |
25 |
chunkFilename: "[name].[contenthash].js", |
| 26 |
}, |
26 |
globalObject: "window", |
| 27 |
module: { |
27 |
}, |
| 28 |
rules: [ |
28 |
module: { |
| 29 |
{ |
29 |
rules: [ |
| 30 |
test: /\.vue$/, |
30 |
{ |
| 31 |
loader: "vue-loader", |
31 |
test: /\.vue$/, |
| 32 |
options: { |
32 |
loader: "vue-loader", |
| 33 |
experimentalInlineMatchResource: true, |
33 |
options: { |
|
|
34 |
experimentalInlineMatchResource: true, |
| 35 |
}, |
| 36 |
exclude: [path.resolve(__dirname, "t/cypress/")], |
| 34 |
}, |
37 |
}, |
| 35 |
exclude: [path.resolve(__dirname, "t/cypress/")], |
38 |
{ |
| 36 |
}, |
39 |
test: /\.ts$/, |
| 37 |
{ |
40 |
loader: "builtin:swc-loader", |
| 38 |
test: /\.ts$/, |
41 |
options: { |
| 39 |
loader: "builtin:swc-loader", |
42 |
jsc: { |
| 40 |
options: { |
43 |
parser: { |
| 41 |
jsc: { |
44 |
syntax: "typescript", |
| 42 |
parser: { |
45 |
}, |
| 43 |
syntax: "typescript", |
|
|
| 44 |
}, |
46 |
}, |
|
|
47 |
appendTsSuffixTo: [/\.vue$/], |
| 45 |
}, |
48 |
}, |
| 46 |
appendTsSuffixTo: [/\.vue$/], |
49 |
exclude: [ |
|
|
50 |
/node_modules/, |
| 51 |
path.resolve(__dirname, "t/cypress/"), |
| 52 |
], |
| 53 |
type: "javascript/auto", |
| 47 |
}, |
54 |
}, |
| 48 |
exclude: [ |
55 |
{ |
| 49 |
/node_modules/, |
56 |
test: /\.css$/i, |
| 50 |
path.resolve(__dirname, "t/cypress/"), |
57 |
type: "javascript/auto", |
| 51 |
], |
58 |
use: ["style-loader", "css-loader"], |
| 52 |
type: "javascript/auto", |
59 |
}, |
| 53 |
}, |
60 |
], |
| 54 |
{ |
61 |
}, |
| 55 |
test: /\.css$/i, |
62 |
plugins: [ |
| 56 |
type: "javascript/auto", |
63 |
new VueLoaderPlugin(), |
| 57 |
use: ["style-loader", "css-loader"], |
64 |
new rspack.DefinePlugin({ |
| 58 |
}, |
65 |
__VUE_OPTIONS_API__: true, |
|
|
66 |
__VUE_PROD_DEVTOOLS__: false, |
| 67 |
__VUE_PROD_HYDRATION_MISMATCH_DETAILS__: false, |
| 68 |
}), |
| 59 |
], |
69 |
], |
|
|
70 |
externals: { |
| 71 |
jquery: "jQuery", |
| 72 |
"datatables.net": "DataTable", |
| 73 |
"datatables.net-buttons": "DataTable", |
| 74 |
"datatables.net-buttons/js/buttons.html5": "DataTable", |
| 75 |
"datatables.net-buttons/js/buttons.print": "DataTable", |
| 76 |
"datatables.net-buttons/js/buttons.colVis": "DataTable", |
| 77 |
}, |
| 60 |
}, |
78 |
}, |
| 61 |
/** |
79 |
{ |
| 62 |
optimization: { |
80 |
experiments: { |
| 63 |
splitChunks: { |
81 |
css: true, |
| 64 |
chunks: "all", |
82 |
outputModule: true, |
| 65 |
cacheGroups: { |
83 |
}, |
| 66 |
default: false, // Disable default cache groups to avoid affecting existing bundles |
84 |
entry: { |
| 67 |
vendors: false, // Disable vendor caching |
85 |
islands: "./koha-tmpl/intranet-tmpl/prog/js/vue/modules/islands.ts", |
| 68 |
vue: { |
86 |
}, |
| 69 |
test: /[\\/]node_modules[\\/]vue[\\/]/, |
87 |
output: { |
| 70 |
name: "vue", |
88 |
filename: "[name].esm.js", |
| 71 |
chunks: "all", |
89 |
path: path.resolve( |
| 72 |
enforce: true, |
90 |
__dirname, |
| 73 |
}, |
91 |
"koha-tmpl/intranet-tmpl/prog/js/vue/dist/" |
|
|
92 |
), |
| 93 |
chunkFilename: "[name].[contenthash].esm.js", |
| 94 |
globalObject: "window", |
| 95 |
library: { |
| 96 |
type: "module", |
| 74 |
}, |
97 |
}, |
| 75 |
}, |
98 |
}, |
|
|
99 |
module: { |
| 100 |
rules: [ |
| 101 |
{ |
| 102 |
test: /\.vue$/, |
| 103 |
loader: "vue-loader", |
| 104 |
options: { |
| 105 |
experimentalInlineMatchResource: true, |
| 106 |
}, |
| 107 |
exclude: [path.resolve(__dirname, "t/cypress/")], |
| 108 |
}, |
| 109 |
{ |
| 110 |
test: /\.ts$/, |
| 111 |
loader: "builtin:swc-loader", |
| 112 |
options: { |
| 113 |
jsc: { |
| 114 |
parser: { |
| 115 |
syntax: "typescript", |
| 116 |
}, |
| 117 |
}, |
| 118 |
appendTsSuffixTo: [/\.vue$/], |
| 119 |
}, |
| 120 |
exclude: [ |
| 121 |
/node_modules/, |
| 122 |
path.resolve(__dirname, "t/cypress/"), |
| 123 |
], |
| 124 |
type: "javascript/auto", |
| 125 |
}, |
| 126 |
{ |
| 127 |
test: /\.css$/i, |
| 128 |
type: "javascript/auto", |
| 129 |
use: ["style-loader", "css-loader"], |
| 130 |
}, |
| 131 |
], |
| 132 |
}, |
| 133 |
plugins: [ |
| 134 |
new VueLoaderPlugin(), |
| 135 |
new rspack.DefinePlugin({ |
| 136 |
__VUE_OPTIONS_API__: true, |
| 137 |
__VUE_PROD_DEVTOOLS__: false, |
| 138 |
__VUE_PROD_HYDRATION_MISMATCH_DETAILS__: false, |
| 139 |
}), |
| 140 |
], |
| 141 |
externals: { |
| 142 |
jquery: "jQuery", |
| 143 |
"datatables.net": "DataTable", |
| 144 |
"datatables.net-buttons": "DataTable", |
| 145 |
"datatables.net-buttons/js/buttons.html5": "DataTable", |
| 146 |
"datatables.net-buttons/js/buttons.print": "DataTable", |
| 147 |
"datatables.net-buttons/js/buttons.colVis": "DataTable", |
| 148 |
}, |
| 76 |
}, |
149 |
}, |
| 77 |
*/ |
150 |
]; |
| 78 |
plugins: [ |
|
|
| 79 |
new VueLoaderPlugin(), |
| 80 |
new rspack.DefinePlugin({ |
| 81 |
__VUE_OPTIONS_API__: true, |
| 82 |
__VUE_PROD_DEVTOOLS__: false, |
| 83 |
__VUE_PROD_HYDRATION_MISMATCH_DETAILS__: false, |
| 84 |
}), |
| 85 |
], |
| 86 |
externals: { |
| 87 |
jquery: "jQuery", |
| 88 |
"datatables.net": "DataTable", |
| 89 |
"datatables.net-buttons": "DataTable", |
| 90 |
"datatables.net-buttons/js/buttons.html5": "DataTable", |
| 91 |
"datatables.net-buttons/js/buttons.print": "DataTable", |
| 92 |
"datatables.net-buttons/js/buttons.colVis": "DataTable", |
| 93 |
}, |
| 94 |
}; |
| 95 |
- |
|
|