-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvue.config.js
40 lines (39 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
38
39
40
const { defineConfig } = require('@vue/cli-service')
const webpack = require('webpack')
module.exports = defineConfig({
transpileDependencies: true,
publicPath: process.env.NODE_ENV === 'production' ? '/' : '/',
devServer: {
https: false,
port: process.env.NODE_ENV === 'production' ? 4888 : 4999,
},
configureWebpack: {
resolve: {
alias: {
zlib: 'browserify-zlib',
},
fallback: {
// crypto: false, // Avoid overriding the 'fs' module,
crypto: require.resolve('crypto-browserify'),
stream: require.resolve('stream-browserify'),
constants: require.resolve('constants-browserify'),
buffer: require.resolve('buffer'),
path: false,
fs: false,
timers: false,
zlib: 'browserify-zlib',
},
},
plugins: [
new webpack.ProvidePlugin({
process: 'process/browser',
}),
new webpack.NormalModuleReplacementPlugin(/node:crypto/, (resource) => {
resource.request = resource.request.replace(/^node:/, '')
}),
new webpack.ProvidePlugin({
Buffer: ['buffer', 'Buffer'],
}),
],
},
})