-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.mix.js
68 lines (63 loc) · 1.69 KB
/
webpack.mix.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
56
57
58
59
60
61
62
63
64
65
66
67
68
const fs = require("fs");
const mix = require("laravel-mix");
const TsconfigPathsPlugin = require("tsconfig-paths-webpack-plugin");
// Main Laravel App Styles and Scripts (homepage)
mix
.ts("resources/js/app.ts", "public/js/app.js")
.sass("resources/sass/app.scss", "public/css/app.css");
// Camino Trekker
mix
.ts("resources/camino-trekker/app.ts", "public/js/camino-trekker.js")
.postCss(
"resources/camino-trekker/main.css",
"public/css/camino-trekker.css"
);
// Camino Creator App
mix
.ts("resources/camino-creator/app.ts", "public/js/camino-creator.js", {
// ignoring any ts errors that crop up during production build for now
transpileOnly: mix.inProduction(),
})
.sass("resources/camino-creator/main.scss", "public/css/camino-creator.css");
// All apps: both production and development
mix
.vue({
version: 3,
options: {
compilerOptions: {
isCustomElement: (tag) =>
["a-text", "a-scene", "a-camera"].includes(tag),
whitespace: "preserve",
},
},
})
.sourceMaps(true)
.webpackConfig({
// uses for resolving aliases like "@/trekker/components"
// instead of using long relative paths
// See tsconfig.json `paths` to set up aliases
resolve: {
plugins: [new TsconfigPathsPlugin({})],
extensions: [".ts", ".js", ".vue"],
},
});
if (mix.inProduction()) {
mix.version();
} else {
mix
.options({
hmrOptions: {
https: true,
host: "localhost",
port: "8001",
},
})
.webpackConfig({
devServer: {
https: {
key: fs.readFileSync("./.cert/key.pem"),
cert: fs.readFileSync("./.cert/cert.pem"),
},
},
});
}