Skip to content

Commit 22f369e

Browse files
committed
add roadhogrc
1 parent 2437942 commit 22f369e

6 files changed

+153
-59
lines changed

.editorconfig

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# http://editorconfig.org
2+
root = true
3+
4+
[*]
5+
indent_style = space
6+
indent_size = 2
7+
end_of_line = lf
8+
charset = utf-8
9+
trim_trailing_whitespace = true
10+
insert_final_newline = true
11+
12+
[*.md]
13+
trim_trailing_whitespace = false
14+
15+
[Makefile]
16+
indent_style = tab

.eslintignore

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
src/**/*-test.js
2+
src/public
3+
src/routes/chart/ECharts/theme
4+
src/routes/chart/highCharts/mapdata

.eslintrc

+60
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
{
2+
"extends": "airbnb",
3+
"rules": {
4+
"arrow-body-style": [0, "never"],
5+
"comma-dangle": [2, "always-multiline"],
6+
"global-require": 0,
7+
"func-names": 0,
8+
"prefer-const": 0,
9+
"import/no-unresolved": 0,
10+
"import/extensions": 0,
11+
"max-len": 0,
12+
"no-unused-expressions": [0, {
13+
"allowShortCircuit": true,
14+
"allowTernary": true
15+
}],
16+
"no-console": 0,
17+
"no-extend-native": 0,
18+
"no-param-reassign": 0,
19+
"no-restricted-syntax": 0,
20+
"no-eval": 0,
21+
"no-continue": 0,
22+
"no-mixed-operators": 0,
23+
"no-plusplus": 0,
24+
"no-unused-vars": [2, { "ignoreRestSiblings": true }],
25+
"no-underscore-dangle": 0,
26+
"space-before-function-paren": [2, "always"],
27+
"semi": [2, "never"],
28+
"import/no-extraneous-dependencies": 0,
29+
"import/prefer-default-export": 0,
30+
"jsx-a11y/no-static-element-interactions": 0,
31+
"jsx-a11y/click-events-have-key-events": 0,
32+
"jsx-a11y/href-no-hash": 0,
33+
"jsx-a11y/anchor-is-valid": 0,
34+
"jsx-a11y/label-has-for": 0,
35+
"react/no-array-index-key": 0,
36+
"react/require-default-props": 0,
37+
"react/forbid-prop-types": 0,
38+
"react/no-string-refs": 0,
39+
"react/no-find-dom-node": 0,
40+
"react/prefer-stateless-function": 0,
41+
"react/jsx-closing-tag-location": 0,
42+
"react/sort-comp": 0,
43+
"react/jsx-no-bind": 0,
44+
"react/no-danger": 0,
45+
"react/jsx-first-prop-new-line": 0,
46+
"react/jsx-filename-extension": 0
47+
},
48+
"parser": "babel-eslint",
49+
"parserOptions": {
50+
"sourceType": "module",
51+
"ecmaVersion": 8,
52+
"ecmaFeatures": {
53+
"jsx": true,
54+
"experimentalObjectRestSpread": true
55+
}
56+
},
57+
"settings": {
58+
"import/resolver": "node"
59+
}
60+
}

.gitignore

+11-59
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,11 @@
1-
# Logs
2-
logs
3-
*.log
4-
npm-debug.log*
5-
yarn-debug.log*
6-
yarn-error.log*
7-
8-
# Runtime data
9-
pids
10-
*.pid
11-
*.seed
12-
*.pid.lock
13-
14-
# Directory for instrumented libs generated by jscoverage/JSCover
15-
lib-cov
16-
17-
# Coverage directory used by tools like istanbul
18-
coverage
19-
20-
# nyc test coverage
21-
.nyc_output
22-
23-
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
24-
.grunt
25-
26-
# Bower dependency directory (https://bower.io/)
27-
bower_components
28-
29-
# node-waf configuration
30-
.lock-wscript
31-
32-
# Compiled binary addons (http://nodejs.org/api/addons.html)
33-
build/Release
34-
35-
# Dependency directories
36-
node_modules/
37-
jspm_packages/
38-
39-
# Typescript v1 declaration files
40-
typings/
41-
42-
# Optional npm cache directory
43-
.npm
44-
45-
# Optional eslint cache
46-
.eslintcache
47-
48-
# Optional REPL history
49-
.node_repl_history
50-
51-
# Output of 'npm pack'
52-
*.tgz
53-
54-
# Yarn Integrity file
55-
.yarn-integrity
56-
57-
# dotenv environment variables file
58-
.env
59-
/dist
1+
dist
2+
node_modules
3+
yarn.lock
4+
npm-debug.log
5+
# ide
6+
.idea
7+
8+
# Mac General
9+
.DS_Store
10+
.AppleDouble
11+
.LSOverride

.roadhogrc.js

+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
const path = require('path')
2+
const { version } = require('./package.json')
3+
4+
const svgSpriteDirs = [
5+
path.resolve(__dirname, 'src/svg/'),
6+
require.resolve('antd').replace(/index\.js$/, '')
7+
]
8+
9+
export default {
10+
entry: 'src/index.js',
11+
svgSpriteLoaderDirs: svgSpriteDirs,
12+
theme: "./theme.config.js",
13+
publicPath: `/${version}/`,
14+
outputPath: `./dist/${version}`,
15+
// 接口代理示例
16+
proxy: {
17+
"/api/v1/weather": {
18+
"target": "https://api.seniverse.com/",
19+
"changeOrigin": true,
20+
"pathRewrite": { "^/api/v1/weather": "/v3/weather" }
21+
},
22+
// "/api/v2": {
23+
// "target": "http://192.168.0.110",
24+
// "changeOrigin": true,
25+
// "pathRewrite": { "^/api/v2" : "/api/v2" }
26+
// }
27+
},
28+
env: {
29+
development: {
30+
extraBabelPlugins: [
31+
"dva-hmr",
32+
"transform-runtime",
33+
[
34+
"import", {
35+
"libraryName": "antd",
36+
"style": true
37+
}
38+
]
39+
]
40+
},
41+
production: {
42+
extraBabelPlugins: [
43+
"transform-runtime",
44+
[
45+
"import", {
46+
"libraryName": "antd",
47+
"style": true
48+
}
49+
]
50+
]
51+
}
52+
},
53+
dllPlugin: {
54+
exclude: ["babel-runtime", "roadhog", "cross-env"],
55+
include: ["dva/router", "dva/saga", "dva/fetch"]
56+
}
57+
}

.roadhogrc.mock.js

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
const mock = {}
2+
require('fs').readdirSync(require('path').join(__dirname + '/src/mock')).forEach(function(file) {
3+
Object.assign(mock, require('./src/mock/' + file))
4+
})
5+
module.exports = mock

0 commit comments

Comments
 (0)