-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnext.config.js
41 lines (40 loc) · 1.13 KB
/
next.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
/*
* @Author: EdisonGu
* @Date: 2022-07-03 23:44:00
* @LastEditors: EdisonGu
* @LastEditTime: 2022-07-17 14:36:09
* @Descripttion:
*/
/** @type {import('next').NextConfig} */
const path = require('path')
const env = process.env.NEXT_PUBLIC_ENV || 'dev'
console.log('----env', env)
const config = {
dev: {
baseDomain: 'http://127.0.0.1:7001',
hostDomain: 'http://localhost:3000'
},
test: {
baseDomain: 'http://www.emojiduck.com/api',
hostDomain: 'http://www.emojiduck.com'
},
production: {
baseDomain: 'https://www.emojiduck.com/api',
hostDomain: 'https://www.emojiduck.com'
}
}[env]
const nextConfig = {
reactStrictMode: false, // 严格模式
images: {
domains: ['tva1.sinaimg.cn','tva2.sinaimg.cn', 'tva3.sinaimg.cn', 'wx1.sinaimg.cn', 'wx2.sinaimg.cn', 'wx3.sinaimg.cn', 'wx4.sinaimg.cn', 'upload.chongnengjihua.com' ]
},
sassOptions: {
includePaths: [path.join(__dirname, 'styles')],
prependData: `@import '@/styles/variables.module.scss';` // 引入全局scss变量
},
env: {
BASE_DOMAIN: config.baseDomain,
HOST_DOMAIN: config.hostDomain
}
}
module.exports = nextConfig