-
Notifications
You must be signed in to change notification settings - Fork 0
/
vue.config.js
30 lines (29 loc) · 945 Bytes
/
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
const { defineConfig } = require('@vue/cli-service')
/**
* These are some necessary steps changing the default webpack config of the Vue CLI
* that need to be changed in order for TypeScript based components to generate their
* declaration (.d.ts) files.
* Discussed here https://github.com/vuejs/vue-cli/issues/1081
*/
const fixEmitDeclarationFilesForTypeScript = {
chainWebpack: (config) => {
if (process.env.NODE_ENV === 'production') {
config.module.rule('ts').uses.delete('cache-loader');
config.module
.rule('ts')
.use('ts-loader')
.loader('ts-loader')
.tap((options) => ({
...options,
transpileOnly: false,
happyPackMode: false,
}));
}
},
parallel: false,
};
module.exports = defineConfig({
...fixEmitDeclarationFilesForTypeScript,
publicPath: process.env.NODE_ENV === 'production' ? '././' : './',
transpileDependencies: true
})