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