Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
yoho-app-web
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
1
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Plain Diff
Browse Files
Authored by
陈峰
6 years ago
Commit
71178bbb78ee9ff2807b1ecc8e222d4703f900d9
2 parents
6a443aa4
7f2b1698
Merge branch 'release/1.0' into feature/ufo
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
88 additions
and
58 deletions
apps/pages/single/ufo/order/index.js
build/webpack.base.conf.js
build/webpack.client.conf.js
build/webpack.server.conf.js
config/common.js
create-app.js
package.json
yarn.lock
apps/pages/single/ufo/order/index.js
View file @
71178bb
export
default
[{
path
:
'/ufo/order/:orderId(\\d+)'
,
name
:
'order'
,
component
:
()
=>
import
(
'./order'
)
component
:
()
=>
import
(
/* webpackChunkName: "order" */
'./order'
)
}];
...
...
build/webpack.base.conf.js
View file @
71178bb
const
webpack
=
require
(
'webpack'
);
const
path
=
require
(
'path'
);
const
FriendlyErrorsPlugin
=
require
(
'friendly-errors-webpack-plugin'
);
const
MiniCssExtractPlugin
=
require
(
'mini-css-extract-plugin'
);
var
PostCompilePlugin
=
require
(
'webpack-post-compile-plugin'
)
var
TransformModulesPlugin
=
require
(
'webpack-transform-modules-plugin'
)
var
PostCompilePlugin
=
require
(
'webpack-post-compile-plugin'
);
var
TransformModulesPlugin
=
require
(
'webpack-transform-modules-plugin'
);
const
VueLoaderPlugin
=
require
(
'vue-loader/lib/plugin'
);
const
pkg
=
require
(
'../package.json'
);
const
isProd
=
process
.
env
.
NODE_ENV
===
'production'
;
...
...
@@ -47,47 +46,6 @@ const webpackConfig = {
test
:
/
\.
js$/
,
use
:
'babel-loader'
,
exclude
:
/node_modules/
},
{
test
:
/
\.
s
?
css$/
,
use
:
[
isProd
?
MiniCssExtractPlugin
.
loader
:
'vue-style-loader'
,
'css-loader'
,
'postcss-loader'
,
{
loader
:
'sass-loader'
,
options
:
{
sourceMap
:
isProd
}
}]
},
{
test
:
/
\.
styl
(
us
)?
$/
,
use
:
[
isProd
?
MiniCssExtractPlugin
.
loader
:
'vue-style-loader'
,
'css-loader'
,
'postcss-loader'
,
{
loader
:
'stylus-loader'
,
options
:
{
sourceMap
:
isProd
,
'resolve url'
:
true
}
}]
},
{
test
:
/
\.(
png|jpe
?
g|gif|svg
)(\?
.*
)?
$/
,
use
:
{
loader
:
'file-loader'
,
options
:
{
name
:
'static/img/[name].[hash:7].[ext]'
}
}
},
{
test
:
/
\.(
woff2
?
|eot|ttf|otf
)(\?
.*
)?
$/
,
use
:
{
loader
:
'file-loader'
,
options
:
{
name
:
'static/img/[name].[hash:7].[ext]'
}
}
},
]
},
...
...
@@ -100,13 +58,6 @@ const webpackConfig = {
]
};
if
(
isProd
)
{
webpackConfig
.
plugins
.
push
(
new
MiniCssExtractPlugin
({
filename
:
'static/css/[name].[contenthash].css'
,
allChunks
:
true
})
);
}
module
.
exports
=
webpackConfig
;
...
...
build/webpack.client.conf.js
View file @
71178bb
const
webpack
=
require
(
'webpack'
);
const
merge
=
require
(
'webpack-merge'
);
const
MiniCssExtractPlugin
=
require
(
'mini-css-extract-plugin'
);
const
BundleAnalyzerPlugin
=
require
(
'webpack-bundle-analyzer'
).
BundleAnalyzerPlugin
;
const
VueSSRClientPlugin
=
require
(
'vue-server-renderer/client-plugin'
);
const
pkg
=
require
(
'../package.json'
);
let
baseConfig
=
require
(
'./webpack.base.conf'
);
const
isProd
=
process
.
env
.
NODE_ENV
===
'production'
;
const
webpackConfig
=
merge
(
baseConfig
,
{
entry
:
{
...
...
@@ -43,6 +45,52 @@ const webpackConfig = merge(baseConfig, {
}
}
},
module
:
{
rules
:
[
{
test
:
/
\.
s
?
css$/
,
use
:
[
isProd
?
MiniCssExtractPlugin
.
loader
:
'vue-style-loader'
,
'css-loader'
,
'postcss-loader'
,
{
loader
:
'sass-loader'
,
options
:
{
sourceMap
:
isProd
}
}]
},
{
test
:
/
\.
styl
(
us
)?
$/
,
use
:
[
isProd
?
MiniCssExtractPlugin
.
loader
:
'vue-style-loader'
,
'css-loader'
,
'postcss-loader'
,
{
loader
:
'stylus-loader'
,
options
:
{
sourceMap
:
isProd
,
'resolve url'
:
true
}
}]
},
{
test
:
/
\.(
png|jpe
?
g|gif|svg
)(\?
.*
)?
$/
,
use
:
{
loader
:
'file-loader'
,
options
:
{
name
:
'static/img/[name].[hash:7].[ext]'
}
}
},
{
test
:
/
\.(
woff2
?
|eot|ttf|otf
)(\?
.*
)?
$/
,
use
:
{
loader
:
'file-loader'
,
options
:
{
name
:
'static/img/[name].[hash:7].[ext]'
}
}
}
]
},
resolve
:
{
alias
:
{
'create-api'
:
'common/create-api-client.js'
...
...
@@ -61,5 +109,12 @@ const webpackConfig = merge(baseConfig, {
if
(
process
.
argv
.
some
(
a
=>
a
===
'--report'
))
{
webpackConfig
.
plugins
.
push
(
new
BundleAnalyzerPlugin
());
}
if
(
isProd
)
{
webpackConfig
.
plugins
.
push
(
new
MiniCssExtractPlugin
({
filename
:
'static/css/[name].[contenthash].css'
,
allChunks
:
true
})
);
}
module
.
exports
=
webpackConfig
;
...
...
build/webpack.server.conf.js
View file @
71178bb
...
...
@@ -17,11 +17,28 @@ let webpackConfig = merge(baseConfig, {
'create-api'
:
'common/create-api-server.js'
}
},
module
:
{
rules
:
[
{
test
:
/
\.
s
?
css$/
,
use
:
'ignore-loader'
},
{
test
:
/
\.
styl
(
us
)?
$/
,
use
:
'ignore-loader'
},
{
test
:
/
\.(
png|jpe
?
g|gif|svg
)(\?
.*
)?
$/
,
use
:
'ignore-loader'
},
{
test
:
/
\.(
woff2
?
|eot|ttf|otf
)(\?
.*
)?
$/
,
use
:
'ignore-loader'
}
]
},
output
:
{
libraryTarget
:
'commonjs2'
,
},
externals
:
nodeExternals
({
whitelist
:
[
/
\.
css$/
,
/
cube-ui/
]
whitelist
:
[
/cube-ui/
]
}),
plugins
:
[
new
VueSSRServerPlugin
({
...
...
config/common.js
View file @
71178bb
...
...
@@ -57,7 +57,7 @@ module.exports = {
activity
:
'//activity.yohobuy.com'
,
index
:
'//m.yohobuy.com'
},
useCache
:
tru
e
,
useCache
:
fals
e
,
loggers
:
{
infoFile
:
{
close
:
true
,
...
...
@@ -99,7 +99,6 @@ module.exports = {
// host: '127.0.0.1',
port
:
'6379'
,
password
:
''
,
enable_offline_queue
:
false
,
retry_strategy
(
options
)
{
if
(
options
.
error
&&
options
.
error
.
code
===
'ECONNREFUSED'
)
{
...
...
@@ -214,7 +213,7 @@ if (isProduction) {
ufo
:
process
.
env
.
UFO_API
||
'http://java-yohoufo-fore.test3.ingress.dev.yohocorp.com/ufo-gateway/'
,
service
:
process
.
env
.
TEST_API
||
'http://api-test3.dev.yohocorp.com/'
},
useCache
:
tru
e
,
useCache
:
fals
e
,
monitorReport
:
{
host
:
'192.168.102.22'
,
port
:
8086
,
...
...
create-app.js
View file @
71178bb
...
...
@@ -7,6 +7,7 @@ const yohoLib = require('yoho-node-lib');
const
pkg
=
require
(
'./package.json'
);
const
devtools
=
require
(
'./doraemon/middleware/devtools'
);
const
_
=
require
(
'lodash'
);
const
Express
=
require
(
'express'
);
// 全局注册library
yohoLib
.
global
(
config
);
...
...
@@ -35,6 +36,8 @@ exports.createApp = async(app) => {
// 添加请求上下文
app
.
use
(
global
.
yoho
.
httpCtx
());
app
.
use
(
'/static'
,
Express
.
static
(
'./dist/yohoblk-wap/bundle/static'
));
app
.
use
(
global
.
yoho
.
hbs
({
extname
:
'.hbs'
,
defaultLayout
:
'layout'
,
...
...
package.json
View file @
71178bb
...
...
@@ -82,6 +82,7 @@
"file-loader"
:
"^2.0.0"
,
"friendly-errors-webpack-plugin"
:
"^1.7.0"
,
"husky"
:
"^1.2.0"
,
"ignore-loader"
:
"^0.1.2"
,
"memory-fs"
:
"^0.4.1"
,
"mini-css-extract-plugin"
:
"^0.5.0"
,
"node-sass"
:
"^4.11.0"
,
...
...
yarn.lock
View file @
71178bb
...
...
@@ -3845,6 +3845,10 @@ ignore-by-default@^1.0.1:
resolved "http://npm.yohops.com/ignore-by-default/-/ignore-by-default-1.0.1.tgz#48ca6d72f6c6a3af00a9ad4ae6876be3889e2b09"
integrity sha1-SMptcvbGo68Aqa1K5odr44ieKwk=
ignore-loader@^0.1.2:
version "0.1.2"
resolved "http://npm.yohops.com/ignore-loader/-/ignore-loader-0.1.2.tgz#d81f240376d0ba4f0d778972c3ad25874117a463"
ignore-walk@^3.0.1:
version "3.0.1"
resolved "https://registry.yarnpkg.com/ignore-walk/-/ignore-walk-3.0.1.tgz#a83e62e7d272ac0e3b551aaa82831a19b69f82f8"
...
...
Please
register
or
login
to post a comment