-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvue.config.js
37 lines (35 loc) · 1.14 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
const child_process = require('child_process');
const fs = require('fs');
const pathlib = require('path');
module.exports = {
outputDir: 'dist/client',
configureWebpack: config => {
if(config.mode == 'production') {
config.plugins.push({
apply: compiler => {
compiler.hooks.afterEmit.tapPromise('LicenseGen', () => new Promise(resolve => {
const ws = fs.createWriteStream(pathlib.join(compiler.outputPath, 'licenses.txt'));
const proc = child_process.spawn('yarn licenses generate-disclaimer', { cwd: compiler.options.context, shell: true });
proc.stdout.pipe(ws);
proc.on('exit', resolve);
}));
}
});
}
},
chainWebpack: config => {
config.entry('app').clear()
.add('./src/client/client.ts')
// These are included by golden-layout.vue, but for some reason in production mode they don't make it into the build
.add('./node_modules/golden-layout/dist/css/goldenlayout-base.css')
.add('./node_modules/golden-layout/dist/css/themes/goldenlayout-light-theme.css')
;
},
};
try {
module.exports.devServer = require('./dev-server.js');
} catch(e) {
if(e.code !== 'MODULE_NOT_FOUND') {
throw e;
}
}