Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
InJoyU
vue-element-admin
提交
a842a4b4
V
vue-element-admin
项目概览
InJoyU
/
vue-element-admin
与 Fork 源项目一致
从无法访问的项目Fork
通知
5
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vue-element-admin
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
a842a4b4
编写于
9月 29, 2017
作者:
P
Pan
提交者:
花裤衩
9月 29, 2017
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refine:refine build_config
上级
be0606eb
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
44 addition
and
34 deletion
+44
-34
build/build.js
build/build.js
+1
-3
build/dev-server.js
build/dev-server.js
+26
-19
build/webpack.base.conf.js
build/webpack.base.conf.js
+8
-8
build/webpack.prod.conf.js
build/webpack.prod.conf.js
+3
-1
config/dev.env.js
config/dev.env.js
+1
-0
config/prod.env.js
config/prod.env.js
+1
-0
config/sit.env.js
config/sit.env.js
+1
-0
package.json
package.json
+3
-3
未找到文件。
build/build.js
浏览文件 @
a842a4b4
...
...
@@ -9,9 +9,7 @@ var webpack = require('webpack');
var
config
=
require
(
'
../config
'
);
var
webpackConfig
=
require
(
'
./webpack.prod.conf
'
);
console
.
log
(
process
.
env
.
NODE_ENV
)
var
spinner
=
ora
(
'
building for
'
+
process
.
env
.
NODE_ENV
+
'
...
'
)
var
spinner
=
ora
(
'
building for
'
+
process
.
env
.
NODE_ENV
+
'
of
'
+
process
.
env
.
env_config
+
'
mode...
'
)
spinner
.
start
()
...
...
build/dev-server.js
浏览文件 @
a842a4b4
require
(
'
./check-versions
'
)();
// 检查 Node 和 npm 版本
var
config
=
require
(
'
../config
'
);
if
(
!
process
.
env
.
NODE_ENV
)
{
process
.
env
.
NODE_ENV
=
JSON
.
parse
(
config
.
dev
.
env
.
NODE_ENV
)
...
...
@@ -28,8 +29,8 @@ var devMiddleware = require('webpack-dev-middleware')(compiler, {
});
var
hotMiddleware
=
require
(
'
webpack-hot-middleware
'
)(
compiler
,
{
log
:
()
=>
{
}
log
:
false
,
heartbeat
:
2000
});
// force page reload when html-webpack-plugin template changes
...
...
@@ -40,8 +41,6 @@ compiler.plugin('compilation', function (compilation) {
})
});
// compiler.apply(new DashboardPlugin());
// proxy api requests
Object
.
keys
(
proxyTable
).
forEach
(
function
(
context
)
{
var
options
=
proxyTable
[
context
]
...
...
@@ -67,18 +66,26 @@ app.use(staticPath, express.static('./static'));
var
uri
=
'
http://localhost:
'
+
port
devMiddleware
.
waitUntilValid
(
function
()
{
console
.
log
(
'
> Listening at
'
+
uri
+
'
\n
'
)
});
module
.
exports
=
app
.
listen
(
port
,
function
(
err
)
{
if
(
err
)
{
console
.
log
(
err
);
return
}
// when env is testing, don't need open it
if
(
autoOpenBrowser
&&
process
.
env
.
NODE_ENV
!==
'
testing
'
)
{
opn
(
uri
)
}
});
var
_resolve
var
readyPromise
=
new
Promise
(
resolve
=>
{
_resolve
=
resolve
})
console
.
log
(
'
> Starting dev server...
'
)
devMiddleware
.
waitUntilValid
(()
=>
{
console
.
log
(
'
> Listening at
'
+
uri
+
'
\n
'
)
// when env is testing, don't need open it
if
(
autoOpenBrowser
&&
process
.
env
.
NODE_ENV
!==
'
testing
'
)
{
opn
(
uri
)
}
_resolve
()
})
var
server
=
app
.
listen
(
port
)
module
.
exports
=
{
ready
:
readyPromise
,
close
:
()
=>
{
server
.
close
()
}
}
build/webpack.base.conf.js
浏览文件 @
a842a4b4
...
...
@@ -14,7 +14,7 @@ module.exports = {
output
:
{
path
:
config
.
build
.
assetsRoot
,
filename
:
'
[name].js
'
,
publicPath
:
process
.
env
.
NODE_ENV
!==
'
development
'
?
config
.
build
.
assetsPublicPath
:
config
.
dev
.
assetsPublicPath
publicPath
:
process
.
env
.
NODE_ENV
===
'
production
'
?
config
.
build
.
assetsPublicPath
:
config
.
dev
.
assetsPublicPath
},
resolve
:
{
extensions
:
[
'
.js
'
,
'
.vue
'
,
'
.json
'
],
...
...
@@ -38,13 +38,13 @@ module.exports = {
module
:
{
rules
:
[
{
test
:
/
\.(
js|vue
)
$/
,
loader
:
'
eslint-loader
'
,
enforce
:
"
pre
"
,
include
:
[
resolve
(
'
src
'
),
resolve
(
'
test
'
)],
options
:
{
formatter
:
require
(
'
eslint-friendly-formatter
'
)
}
test
:
/
\.(
js|vue
)
$/
,
loader
:
'
eslint-loader
'
,
enforce
:
"
pre
"
,
include
:
[
resolve
(
'
src
'
),
resolve
(
'
test
'
)],
options
:
{
formatter
:
require
(
'
eslint-friendly-formatter
'
)
}
},
{
test
:
/
\.
vue$/
,
...
...
build/webpack.prod.conf.js
浏览文件 @
a842a4b4
...
...
@@ -9,7 +9,7 @@ var HtmlWebpackPlugin = require('html-webpack-plugin')
var
ExtractTextPlugin
=
require
(
'
extract-text-webpack-plugin
'
)
var
OptimizeCSSPlugin
=
require
(
'
optimize-css-assets-webpack-plugin
'
)
var
env
=
process
.
env
.
NODE_ENV
===
'
production
'
?
config
.
build
.
prodEnv
:
config
.
build
.
sitEnv
var
env
=
config
.
build
[
process
.
env
.
config_env
+
'
Env
'
]
function
resolveApp
(
relativePath
)
{
return
path
.
resolve
(
relativePath
);
...
...
@@ -117,9 +117,11 @@ var webpackConfig = merge(baseWebpackConfig, {
}])
]
})
if
(
config
.
build
.
bundleAnalyzerReport
)
{
var
BundleAnalyzerPlugin
=
require
(
'
webpack-bundle-analyzer
'
).
BundleAnalyzerPlugin
webpackConfig
.
plugins
.
push
(
new
BundleAnalyzerPlugin
())
}
module
.
exports
=
webpackConfig
config/dev.env.js
浏览文件 @
a842a4b4
module
.
exports
=
{
NODE_ENV
:
'
"development"
'
,
ENV_CONFIG
:
'
"dev"
'
,
BASE_API
:
'
"https://api-dev"
'
,
APP_ORIGIN
:
'
"https://wallstreetcn.com"
'
}
config/prod.env.js
浏览文件 @
a842a4b4
module
.
exports
=
{
NODE_ENV
:
'
"production"
'
,
ENV_MODE
:
'
"prod"
'
,
BASE_API
:
'
"https://api-prod"
'
,
APP_ORIGIN
:
'
"https://wallstreetcn.com"
'
};
config/sit.env.js
浏览文件 @
a842a4b4
module
.
exports
=
{
NODE_ENV
:
'
"production"
'
,
ENV_CONFIG
:
'
"sit"
'
,
BASE_API
:
'
"https://api-sit"
'
,
APP_ORIGIN
:
'
"https://wallstreetcn.com"
'
};
package.json
浏览文件 @
a842a4b4
...
...
@@ -7,9 +7,9 @@
"private"
:
true
,
"scripts"
:
{
"dev"
:
"node build/dev-server.js"
,
"build:prod"
:
"cross-env NODE_ENV=production node build/build.js"
,
"build:sit"
:
"cross-env NODE_ENV=sit node build/build.js"
,
"build:sit-preview"
:
"cross-env NODE_ENV=sit npm_config_preview=true npm_config_report=true node build/build.js"
,
"build:prod"
:
"cross-env NODE_ENV=production
env_config=prod
node build/build.js"
,
"build:sit"
:
"cross-env NODE_ENV=
production env_config=
sit node build/build.js"
,
"build:sit-preview"
:
"cross-env NODE_ENV=sit
env_config=sit
npm_config_preview=true npm_config_report=true node build/build.js"
,
"lint"
:
"eslint --ext .js,.vue src"
},
"dependencies"
:
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录