Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
X
xiaomai-cloud-class-web
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
xiaomai-cloud-class
xiaomai-cloud-class-web
Commits
413edfc7
Commit
413edfc7
authored
May 30, 2021
by
pangguoming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "fix:修复环境分支切换问题"
This reverts commit
840754f6
parent
840754f6
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
126 deletions
+27
-126
.vscode/settings.json
+0
-101
config/env.js
+27
-25
No files found.
.vscode/settings.json
deleted
100644 → 0
View file @
840754f6
//
将设置放入此文件中以覆盖默认设置
{
"editor.fontSize"
:
16
,
"editor.wordWrapColumn"
:
160
,
"editor.wordWrap"
:
"on"
,
"editor.tabSize"
:
2
,
"editor.formatOnType"
:
true
,
"editor.formatOnSave"
:
true
,
"editor.formatOnPaste"
:
true
,
"workbench.iconTheme"
:
"vs-seti"
,
"fileheader.customMade"
:
{
"Author"
:
"庞国铭"
,
"Date"
:
"Do not edit"
,
//
这里就得这么填,才能自动校准时间
"LastEditors"
:
"fusanqiasng"
,
"LastEditTime"
:
"Do not edit"
,
//
这里就得这么填,才能自动校准时间
"Description"
:
"描述一下咯"
,
"@Copyrigh"
:
"© 2020 杭州杰竞科技有限公司 版权所有"
},
"px-to-rem.px-per-rem"
:
50
,
"beautify.tabSize"
:
2
,
"files.associations"
:
{
"*.vue"
:
"vue"
,
"*.jsx"
:
"javascript"
,
"*.wxss"
:
"css"
,
"*.wxs"
:
"javascript"
},
"emmet.syntaxProfiles"
:
{
"vue-html"
:
"html"
,
"vue"
:
"html"
},
"eslint.options"
:
{
"extensions"
:
[
".js"
,
".vue"
,
"jsx"
,
"tsx"
,
".ts"
]
},
"eslint.run"
:
"onSave"
,
"window.zoomLevel"
:
-1
,
"gitlens.advanced.messages"
:
{
"suppressCommitHasNoPreviousCommitWarning"
:
false
,
"suppressCommitNotFoundWarning"
:
false
,
"suppressFileNotUnderSourceControlWarning"
:
false
,
"suppressGitVersionWarning"
:
false
,
"suppressLineUncommittedWarning"
:
false
,
"suppressNoRepositoryWarning"
:
false
,
"suppressResultsExplorerNotice"
:
true
,
"suppressShowKeyBindingsNotice"
:
true
,
"suppressUpdateNotice"
:
false
,
"suppressWelcomeNotice"
:
true
},
"python.disablePromptForFeatures"
:
[
"pylint"
],
"gitlens.keymap"
:
"alternate"
,
"gitlens.gitExplorer.files.layout"
:
"tree"
,
"gitlens.views.repositories.files.layout"
:
"tree"
,
"gitlens.views.lineHistory.enabled"
:
true
,
"git.ignoreMissingGitWarning"
:
true
,
"javascript.updateImportsOnFileMove.enabled"
:
"always"
,
"gitlens.gitCommands.skipConfirmations"
:
[
"fetch:command"
,
"stash-push:command"
,
"switch:command"
,
"pull:menu"
],
"gitlens.gitCommands.closeOnFocusOut"
:
true
,
"auto-close-tag.activationOnLanguage"
:
[
"xml"
,
"php"
,
"blade"
,
"ejs"
,
"jinja"
,
"javascript"
,
"javascriptreact"
,
"typescript"
,
"typescriptreact"
,
"plaintext"
,
"markdown"
,
"vue"
,
"liquid"
,
"erb"
,
"lang-cfml"
,
"cfml"
,
"HTML (EEx)"
,
"HTML (Eex)"
,
"plist"
],
//
"files.autoSave"
:
"100000"
,
//
同上prettier格式化代码
"prettier.jsxSingleQuote"
:
true
,
//
使用单引号
"prettier.singleQuote"
:
true
,
//
使用制表符
(tab)
缩进行而不是空格
(space)。
"prettier.useTabs"
:
false
,
//结尾无分好
"prettier.semi"
:
false
,
//
无尾随逗号
"prettier.trailingComma"
:
"es5"
,
//是否在对象属性添加空格
"prettier.bracketSpacing"
:
true
,
//
将
>
多行
JSX
元素放在最后一行的末尾,而不是单独放在下一行(不适用于自闭元素)
"prettier.jsxBracketSameLine"
:
true
,
//
箭头函数单个参数不加分号
"prettier.arrowParens"
:
"always"
,
//
指定代码换行的行长度。单行代码宽度超过指定的最大宽度,将会换行,如果都不想换,
"prettier.printWidth"
:
160
,
//是否换行
Prose
Wrap
"prettier.proseWrap"
:
"preserve"
,
"editor.defaultFormatter"
:
"esbenp.prettier-vscode"
,
"editor.codeActionsOnSave"
:
null
}
config/env.js
View file @
413edfc7
'use strict'
'use strict'
;
const
fs
=
require
(
'fs'
)
const
path
=
require
(
'path'
)
const
paths
=
require
(
'./paths'
)
const
fs
=
require
(
'fs'
)
;
const
path
=
require
(
'path'
)
;
const
paths
=
require
(
'./paths'
)
;
// Make sure that including paths.js after env.js will read .env variables.
delete
require
.
cache
[
require
.
resolve
(
'./paths'
)]
delete
require
.
cache
[
require
.
resolve
(
'./paths'
)]
;
const
NODE_ENV
=
process
.
env
.
NODE_ENV
const
NODE_ENV
=
process
.
env
.
NODE_ENV
;
if
(
!
NODE_ENV
)
{
throw
new
Error
(
'The NODE_ENV environment variable is required but was not specified.'
)
throw
new
Error
(
'The NODE_ENV environment variable is required but was not specified.'
);
}
// https://github.com/bkeepers/dotenv#what-other-env-files-can-i-use
...
...
@@ -21,22 +23,22 @@ const dotenvFiles = [
// results for everyone
NODE_ENV
!==
'test'
&&
`
${
paths
.
dotenv
}
.local`
,
paths
.
dotenv
,
].
filter
(
Boolean
)
].
filter
(
Boolean
)
;
// Load environment variables from .env* files. Suppress warnings using silent
// if this file is missing. dotenv will never modify any environment variables
// that have already been set. Variable expansion is supported in .env files.
// https://github.com/motdotla/dotenv
// https://github.com/motdotla/dotenv-expand
dotenvFiles
.
forEach
(
(
dotenvFile
)
=>
{
dotenvFiles
.
forEach
(
dotenvFile
=>
{
if
(
fs
.
existsSync
(
dotenvFile
))
{
require
(
'dotenv-expand'
)(
require
(
'dotenv'
).
config
({
path
:
dotenvFile
,
})
)
)
;
}
})
})
;
// We support resolving modules according to `NODE_PATH`.
// This lets you use absolute paths in imports inside large monorepos:
...
...
@@ -47,24 +49,24 @@ dotenvFiles.forEach((dotenvFile) => {
// Otherwise, we risk importing Node.js core modules into an app instead of webpack shims.
// https://github.com/facebook/create-react-app/issues/1023#issuecomment-265344421
// We also resolve them to make sure all tools using them work consistently.
const
appDirectory
=
fs
.
realpathSync
(
process
.
cwd
())
const
appDirectory
=
fs
.
realpathSync
(
process
.
cwd
())
;
process
.
env
.
NODE_PATH
=
(
process
.
env
.
NODE_PATH
||
''
)
.
split
(
path
.
delimiter
)
.
filter
(
(
folder
)
=>
folder
&&
!
path
.
isAbsolute
(
folder
))
.
map
(
(
folder
)
=>
path
.
resolve
(
appDirectory
,
folder
))
.
join
(
path
.
delimiter
)
.
filter
(
folder
=>
folder
&&
!
path
.
isAbsolute
(
folder
))
.
map
(
folder
=>
path
.
resolve
(
appDirectory
,
folder
))
.
join
(
path
.
delimiter
)
;
// Grab NODE_ENV and REACT_APP_* environment variables and prepare them to be
// injected into the application via DefinePlugin in webpack configuration.
const
REACT_APP
=
/^REACT_APP_/i
const
REACT_APP
=
/^REACT_APP_/i
;
function
getClientEnvironment
(
publicUrl
)
{
const
raw
=
Object
.
keys
(
process
.
env
)
.
filter
(
(
key
)
=>
REACT_APP
.
test
(
key
))
.
filter
(
key
=>
REACT_APP
.
test
(
key
))
.
reduce
(
(
env
,
key
)
=>
{
env
[
key
]
=
process
.
env
[
key
]
return
env
env
[
key
]
=
process
.
env
[
key
]
;
return
env
;
},
{
// Useful for determining whether we’re running in production mode.
...
...
@@ -85,16 +87,16 @@ function getClientEnvironment(publicUrl) {
WDS_SOCKET_PATH
:
process
.
env
.
WDS_SOCKET_PATH
,
WDS_SOCKET_PORT
:
process
.
env
.
WDS_SOCKET_PORT
,
}
)
)
;
// Stringify all values so we can feed into webpack DefinePlugin
const
stringified
=
{
'process.env'
:
Object
.
keys
(
raw
).
reduce
((
env
,
key
)
=>
{
env
[
key
]
=
JSON
.
stringify
(
raw
[
key
])
return
env
env
[
key
]
=
JSON
.
stringify
(
raw
[
key
])
;
return
env
;
},
{}),
}
}
;
return
{
raw
,
stringified
}
return
{
raw
,
stringified
}
;
}
module
.
exports
=
getClientEnvironment
module
.
exports
=
getClientEnvironment
;
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment