Authored by 陈峰

build

... ... @@ -44,7 +44,7 @@ app.use(cookieSession({
}));
app.use(compression());
app.use(favicon(path.join(__dirname, '/favicon.ico')));
app.use(express.static(path.join(__dirname, 'public')));
app.use(express.static(path.join(__dirname, 'public/dist')));
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({
extended: false
... ...
... ... @@ -11,8 +11,8 @@
<link rel="stylesheet" media="all" href="//{{devHost}}:5001/common.css?t={{startTime}}">
<link rel="stylesheet" media="all" href="//{{devHost}}:5001/{{module}}.{{page}}.css?t={{startTime}}">
{{^}}
<link rel="stylesheet" media="all" href="//cdn.yoho.cn/yoho-activity-platform/{{version}}/common.css?t={{startTime}}">
<link rel="stylesheet" media="all" href="//cdn.yoho.cn/yoho-activity-platform/{{version}}/{{module}}.{{page}}.css?t={{startTime}}">
<link rel="stylesheet" media="all" href="/yoho-activity-platform/{{version}}/common.css?t={{startTime}}">
<link rel="stylesheet" media="all" href="/yoho-activity-platform/{{version}}/{{module}}.{{page}}.css?t={{startTime}}">
{{/if}}
</head>
... ... @@ -49,8 +49,8 @@
<script src="//{{devHost}}:5001/libs.js"></script>
<script src="//{{devHost}}:5001/{{module}}.{{page}}.js"></script>
{{^}}
<script src="//cdn.yoho.cn/yoho-activity-platform/{{version}}/libs.js?t={{startTime}}"></script>
<script src="//cdn.yoho.cn/yoho-activity-platform/{{version}}/{{module}}.{{page}}.js?t={{startTime}}"></script>
<script src="/yoho-activity-platform/{{version}}/libs.js?t={{startTime}}"></script>
<script src="/yoho-activity-platform/{{version}}/{{module}}.{{page}}.js?t={{startTime}}"></script>
{{/if}}
</body>
</html>
... ...
... ... @@ -20,7 +20,7 @@ const devInfo = require('./dev-info.js');
const distDir = path.join(__dirname, `../public/dist/${config.name}/${config.version}`);
const dist = {
img: distDir + '/img',
font: distDir + '/font'
font: distDir + '/fonts'
};
exports.postcssPlugin = (et) => {
... ...
... ... @@ -78,7 +78,7 @@ module.exports = (env) => {
entry: getEntries(),
output: {
path: path.join(__dirname, '../public/bundle'), // absolute path
filename: '[name].js'
filename: 'js/[name].js'
},
module: {
rules: [{
... ... @@ -103,7 +103,7 @@ module.exports = (env) => {
children: false
},
plugins: [
new ExtractTextPlugin('[name].css'),
new ExtractTextPlugin('css/[name].css'),
new HappyPack({
id: 'js',
threadPool: happyThreadPool,
... ...
... ... @@ -14,7 +14,7 @@ module.exports = {
app: 'h5',
appVersion: '5.8.0', // 调用api的版本
port: 6006,
assetUrl: '//127.0.0.1:5001',
assetUrl: `/yoho-activity-platform/${pkg.version}/`,
domains: {
api: 'http://api-test3.yohops.com:9999/',
service: 'http://service-test3.yohops.com:9999/',
... ... @@ -75,7 +75,7 @@ module.exports = {
if (isProduction) {
Object.assign(module.exports, {
appName: 'm.yohobuy.com',
assetUrl: `//cdn.yoho.cn/yoho-activity-platform/${pkg.version}/`,
assetUrl: `/yoho-activity-platform/${pkg.version}/`,
domains: {
api: 'http://api.yoho.yohoops.org/',
service: 'http://service.yoho.yohoops.org/',
... ... @@ -113,7 +113,7 @@ if (isProduction) {
} else if (isTest) {
Object.assign(module.exports, {
appName: 'm.yohobuy.com for test',
assetUrl: `//cdn.yoho.cn/yoho-activity-platform/${pkg.version}/`,
assetUrl: `/yoho-activity-platform/${pkg.version}/`,
domains: {
api: process.env.TEST_API || 'http://api-test1.yohops.com:9999/',
service: process.env.TEST_SERVICE || 'http://service-test1.yohops.com:9999/',
... ...
... ... @@ -11,7 +11,7 @@
<link rel="stylesheet" media="all" href="//{{devHost}}:5001/common.css?t={{startTime}}">
{{^}}
<link rel="stylesheet" media="all"
href="//cdn.yoho.cn/yoho-activity-platform/{{version}}/common.css?t={{startTime}}">
href="/yoho-activity-platform/{{version}}/common.css?t={{startTime}}">
{{/if}}
</head>
<body class="nav-md">
... ...
... ... @@ -11,7 +11,7 @@
<link rel="stylesheet" media="all" href="//{{devHost}}:5001/common.css?t={{startTime}}">
{{^}}
<link rel="stylesheet" media="all"
href="//cdn.yoho.cn/yoho-activity-platform/{{version}}/common.css?t={{startTime}}">
href="/yoho-activity-platform/{{version}}/common.css?t={{startTime}}">
{{/if}}
</head>
<body class="nav-md">
... ...
... ... @@ -11,7 +11,7 @@
<link rel="stylesheet" media="all" href="//{{devHost}}:5001/common.css?t={{startTime}}">
{{^}}
<link rel="stylesheet" media="all"
href="//cdn.yoho.cn/yoho-activity-platform/{{version}}/common.css?t={{startTime}}">
href="/yoho-activity-platform/{{version}}/common.css?t={{startTime}}">
{{/if}}
</head>
<body class="nav-md">
... ...
... ... @@ -11,9 +11,9 @@
<link rel="stylesheet" media="all" href="//{{devHost}}:5001/common.css?t={{startTime}}">
<link rel="stylesheet" media="all" href="//{{devHost}}:5001/{{module}}.{{page}}.css?t={{startTime}}">
{{^}}
<link rel="stylesheet" media="all" href="//cdn.yoho.cn/yoho-activity-platform/{{version}}/common.css?t={{startTime}}">
<link rel="stylesheet" media="all" href="/yoho-activity-platform/{{version}}/css/common.css?t={{startTime}}">
<link rel="stylesheet" media="all"
href="//cdn.yoho.cn/yoho-activity-platform/{{version}}/{{module}}.{{page}}.css?t={{startTime}}">
href="/yoho-activity-platform/{{version}}/css/{{module}}.{{page}}.css?t={{startTime}}">
{{/if}}
</head>
... ... @@ -111,8 +111,8 @@
<script src="//{{devHost}}:5001/libs.js"></script>
<script src="//{{devHost}}:5001/{{module}}.{{page}}.js"></script>
{{^}}
<script src="//cdn.yoho.cn/yoho-activity-platform/{{version}}/libs.js?t={{startTime}}"></script>
<script src="//cdn.yoho.cn/yoho-activity-platform/{{version}}/{{module}}.{{page}}.js?t={{startTime}}"></script>
<script src="/yoho-activity-platform/{{version}}/libs.js?t={{startTime}}"></script>
<script src="/yoho-activity-platform/{{version}}/js/{{module}}.{{page}}.js?t={{startTime}}"></script>
{{/if}}
</body>
</html>
... ...