-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathvue.config.js
55 lines (53 loc) · 1.45 KB
/
vue.config.js
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
/* eslint-env node */
const dotenv = require("dotenv").config();
const path = require("path");
/**
* @type {import('@vue/cli-service').ProjectOptions}
*/
module.exports = {
filenameHashing: false,
outputDir: "./dist/ui",
transpileDependencies: ["vuetify"],
chainWebpack: (config) => {
config.optimization.minimize(false);
config.module
.rule("js")
.use("babel-loader")
.tap(() => ({ rootMode: "upward" }));
// config.module
// .rule('ts')
// .use('ts-loader')
// .merge({
// options: {
// configFile: path.join(__dirname, "src/tsconfig.json"),
// },
// });
// config
// .plugin('fork-ts-checker')
// .tap(args => {
// console.log("ARGS", args);
// args[0].typescript.configFile = path.join(__dirname, "src/tsconfig.json");
// return args;
// });
config.plugin("define").tap((definitions) => {
const env = dotenv.parsed;
// TODO This masks the process.env that must be set elsewhere.
definitions[0]["process.env"] = JSON.stringify({
NODE_ENV: process.env.NODE_ENV,
BASE_URL: process.env.BASE_URL, // TODO This isn't set at this point
...env,
});
return definitions;
});
},
configureWebpack: {
resolve: {
alias: {
"@": path.join(__dirname, "/src/ui/app"),
},
},
entry: {
app: path.join(__dirname, "src", "ui", "app", "main.ts"),
},
},
};