Bug 36511: Some scripts missing a dependency following Bug 24879
[koha.git] / webpack.config.js
1 const { VueLoaderPlugin } = require("vue-loader");
2 const autoprefixer = require("autoprefixer");
3 const path = require("path");
4 const webpack = require('webpack');
5
6 module.exports = {
7   entry: {
8     erm: "./koha-tmpl/intranet-tmpl/prog/js/vue/modules/erm.ts",
9   },
10   output: {
11     filename: "[name].js",
12     path: path.resolve(__dirname, "koha-tmpl/intranet-tmpl/prog/js/vue/dist/"),
13     chunkFilename: "[name].js",
14   },
15   module: {
16     rules: [
17       {
18         test: /\.vue$/,
19         loader: "vue-loader",
20         exclude: [path.resolve(__dirname, "t/cypress/")],
21       },
22       {
23         test: /\.ts$/,
24         loader: 'ts-loader',
25         options: {
26           appendTsSuffixTo: [/\.vue$/]
27         },
28         exclude: [path.resolve(__dirname, "t/cypress/")],
29       },
30       {
31         test: /\.css$/,
32         use: ['style-loader', 'css-loader'],
33       }
34     ],
35   },
36   plugins: [
37     new VueLoaderPlugin(),
38     new webpack.DefinePlugin({
39       __VUE_OPTIONS_API__: true,
40       __VUE_PROD_DEVTOOLS__: false,
41     }),
42   ],
43 };