This repository has been archived by the owner on Oct 31, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 29
/
vue.config.js
127 lines (111 loc) · 3.13 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
const path = require("path");
const markdownItClass = require("markdown-it");
process.env.VUE_APP_VERSION = require("./package.json").version;
const mdLoader = markdownItClass({
html: true,
breaks: true,
linkify: true,
});
const mdLoaderPlain = markdownItClass({
html: true,
breaks: true,
linkify: true,
});
// mdLoader.preventExtract = true;
mdLoader.raw = true;
mdLoader.wrapper = "div";
mdLoaderPlain.raw = true;
mdLoaderPlain.wrapper = "div";
mdLoaderPlain.wrapperClass = "vue-markdown-plain";
const GenomeFeatureViewer = path.resolve(
__dirname,
"node_modules/genomefeaturecomponent/src/index.js"
);
const GenomeFeatureViewerCSS = path.resolve(
__dirname,
"node_modules/genomefeaturecomponent/src/GenomeFeatureViewer.css"
);
const vueConfig = {
runtimeCompiler: true,
// outputDir: 'dist',
publicPath: "/",
lintOnSave: false,
pluginOptions: {
// https://github.com/mrbbot/vue-cli-plugin-webpack-bundle-analyzer
// https://github.com/webpack-contrib/webpack-bundle-analyzer#options-for-plugin
webpackBundleAnalyzer: {
analyzerMode: "disabled",
},
},
configureWebpack: {
resolve: {
alias: {
// https://vuejs.org/v2/guide/installation.html#Runtime-Compiler-vs-Runtime-only
vue$: "vue/dist/vue.common.js",
GenomeFeatureViewer: GenomeFeatureViewer,
GenomeFeatureViewerCSS: GenomeFeatureViewerCSS,
esprima$: path.join(__dirname, "src/NOP.js"),
},
},
},
chainWebpack: (config) => {
// config.resolve.alias.set(
// 'GenomeFeatureComponent',
// GenomeFeatureComponent
// );
config.resolveLoader.modules.add(path.resolve("./src/loaders/"));
config.module
.rule("README")
.test(/\.md$/)
.include.add(path.resolve("./README.md"))
.end()
.use("vue-loader")
.loader("vue-loader")
.end()
.use("vue-markdown-loader")
.loader("vue-markdown-loader-improved.js")
.options(mdLoaderPlain);
config.module
.rule("CONTRIBUTING")
.test(/\.md$/)
.include.add(path.resolve("./CONTRIBUTING.md"))
.end()
.use("vue-loader")
.loader("vue-loader")
.end()
.use("vue-markdown-loader")
.loader("vue-markdown-loader-improved.js")
.options(mdLoaderPlain);
config.module
.rule("md")
.test(/\.md$/)
.include.add(path.resolve("src/"))
.end()
.use("vue-loader")
.loader("vue-loader")
.end()
.use("vue-markdown-loader")
// Original: .loader('vue-markdown-loader/lib/markdown-compiler')
.loader("vue-markdown-loader-improved.js")
.options(mdLoader);
config.module
.rule("vue")
.use("vue-loader")
.loader("vue-loader")
.tap((options) => {
/* eslint no-param-reassign: 0 */
options.transformAssetUrls = {
img: "src",
image: "xlink:href",
"b-img": "src",
"b-img-lazy": ["src", "blank-src"],
"b-card": "img-src",
"b-card-img": "img-src",
"b-carousel-slide": "img-src",
"b-embed": "src",
};
return options;
});
},
};
module.exports = vueConfig;