-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathwebpack.config.js
More file actions
60 lines (59 loc) · 1.61 KB
/
webpack.config.js
File metadata and controls
60 lines (59 loc) · 1.61 KB
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
const { VueLoaderPlugin } = require("vue-loader");
const path = require("path");
const webpack = require("webpack");
module.exports = {
entry: {
erm: "./koha-tmpl/intranet-tmpl/prog/js/vue/modules/erm.ts",
},
output: {
filename: "[name].js",
path: path.resolve(
__dirname,
"koha-tmpl/intranet-tmpl/prog/js/vue/dist/"
),
chunkFilename: "[name].js",
},
resolve: {
alias: {
// Prevent webpack from trying to compile islands.ts
"./islands": false,
"./islands.ts": false,
},
},
module: {
rules: [
{
test: /\.vue$/,
loader: "vue-loader",
exclude: [path.resolve(__dirname, "t/cypress/")],
},
{
test: /\.ts$/,
loader: "ts-loader",
options: {
appendTsSuffixTo: [/\.vue$/],
transpileOnly: true,
},
exclude: [
path.resolve(__dirname, "t/cypress/"),
/islands\.ts$/,
],
},
{
test: /\.css$/,
use: ["style-loader", "css-loader"],
},
],
},
plugins: [
new VueLoaderPlugin(),
new webpack.DefinePlugin({
__VUE_OPTIONS_API__: true,
__VUE_PROD_DEVTOOLS__: false,
__VUE_PROD_HYDRATION_MISMATCH_DETAILS__: false,
}),
new webpack.IgnorePlugin({
resourceRegExp: /islands\.ts$/,
}),
],
};