-
Notifications
You must be signed in to change notification settings - Fork 34
/
Copy pathvue.config.js
90 lines (81 loc) · 2.94 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
var GitRevisionPlugin = require('git-revision-webpack-plugin')
let gitRevisionPlugin = new GitRevisionPlugin()
module.exports = {
lintOnSave: true,
publicPath: '',
devServer: {
host: "0.0.0.0",
https: true,
disableHostCheck: true,
port: 8443,
public: '10.9.22.176:8443',
},
configureWebpack: config => {
// config.plugins.push(new DefinePlugin({
// 'VERSION': JSON.stringify(gitRevisionPlugin.version()),
// 'COMMITHASH': JSON.stringify(gitRevisionPlugin.commithash()),
// 'BRANCH': JSON.stringify(gitRevisionPlugin.branch()),
// }))
},
// configureWebpack: {
// entry: {
// polyfillstest: './src/polyfill-mediarecorder.js'
// }
// },
// tweak internal webpack configuration.
// see https://github.com/vuejs/vue-cli/blob/dev/docs/webpack.md
chainWebpack: config => {
config.plugin('define').tap(options => {
Object.assign(options[0], {
'WEBPACK_VERSION': JSON.stringify(gitRevisionPlugin.version()),
'WEBPACK_COMMITHASH': JSON.stringify(gitRevisionPlugin.commithash()),
'WEBPACK_BRANCH': JSON.stringify(gitRevisionPlugin.branch()),
'WEBPACK_TIMESTAMP': JSON.stringify(new Date())
})
// There has got to be a better way...
// Currently this is required for loading the webworkers which have different rules and restrictions.
if (process.env.NODE_ENV === 'production') {
Object.assign(options[0], {
'BASE_URL': JSON.stringify('https://kaliatech.github.io/web-audio-recording-tests/dist'),
})
}
else {
Object.assign(options[0], {
//'BASE_URL': JSON.stringify('https://localhost:8443'),
'BASE_URL': JSON.stringify('https://10.9.22.176:8443')
})
}
return options
})
//# worker-loaded webified the workers and allowed use of ES6 imports inside the workers. However, that workers were
// never reloaded from cache. Webpack service had to be stopped, and cache directory deleted, before getting changes.
// Also, the encoders are large, so probably not good to load in to the main bundle anyways.
// config.module
// .rule('worker')
// .test(/-worker\.js$/)
// .use('worker-loader')
// .loader('worker-loader')
// .options({inline: true})
// config.loaders.push(new )
// config.entryPoints.delete('app')
// config
// .entry('polyfill-mediarecorder')
// .add('./src/polyfill-mediarecorder.js')
// .end()
// .entry('app')
// .add('./src/main.js')
// .end()
// config.plugin('html')
// .tap(([options]) => [Object.assign(options, {
// excludeChunks: ['polyfill-mediarecorder']
// })])
// // A, remove the plugin
// config.plugins.delete('prefetch');
// or:
// B. Alter settings:
// config.plugin('prefetch').tap(options => {
// options.fileBlackList.push([polyfill(.)+?\.js$/]);
// return options;
// });
}
}