-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.f2econfig.js
More file actions
31 lines (29 loc) · 890 Bytes
/
.f2econfig.js
File metadata and controls
31 lines (29 loc) · 890 Bytes
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
// @ts-check
const { argv } = process
const build = argv[argv.length - 1] === 'build'
const { join } = require('path')
/**
* @type {import('f2e-server').F2EConfig}
*/
const config = {
livereload: !build,
build,
gzip: true,
useLess: true,
buildFilter: (p) => /^(index|css|src)/.test(p),
outputFilter: (p) => /^(index|css\/?(?=bundle|$)|static)/.test(p),
middlewares: [
{
middleware: 'proxy',
test: /^\/weather\.js/,
url: 'http://d1.weather.com.cn/',
pathname: () => 'dingzhi/101010100.html',
renderHeaders: () => ({ referer: 'http://www.weather.com.cn/weather1d/101010100.shtml' })
},
{ middleware: 'template', test: /index\.html/ },
{ middleware: 'webpack' },
require('./lib').default
],
output: join(__dirname, './output')
}
module.exports = config