Authored by 陈峰

build

@@ -44,7 +44,7 @@ app.use(cookieSession({ @@ -44,7 +44,7 @@ app.use(cookieSession({
44 })); 44 }));
45 app.use(compression()); 45 app.use(compression());
46 app.use(favicon(path.join(__dirname, '/favicon.ico'))); 46 app.use(favicon(path.join(__dirname, '/favicon.ico')));
47 -app.use(express.static(path.join(__dirname, 'public'))); 47 +app.use(express.static(path.join(__dirname, 'public/dist')));
48 app.use(bodyParser.json()); 48 app.use(bodyParser.json());
49 app.use(bodyParser.urlencoded({ 49 app.use(bodyParser.urlencoded({
50 extended: false 50 extended: false
@@ -11,8 +11,8 @@ @@ -11,8 +11,8 @@
11 <link rel="stylesheet" media="all" href="//{{devHost}}:5001/common.css?t={{startTime}}"> 11 <link rel="stylesheet" media="all" href="//{{devHost}}:5001/common.css?t={{startTime}}">
12 <link rel="stylesheet" media="all" href="//{{devHost}}:5001/{{module}}.{{page}}.css?t={{startTime}}"> 12 <link rel="stylesheet" media="all" href="//{{devHost}}:5001/{{module}}.{{page}}.css?t={{startTime}}">
13 {{^}} 13 {{^}}
14 - <link rel="stylesheet" media="all" href="//cdn.yoho.cn/yoho-activity-platform/{{version}}/common.css?t={{startTime}}">  
15 - <link rel="stylesheet" media="all" href="//cdn.yoho.cn/yoho-activity-platform/{{version}}/{{module}}.{{page}}.css?t={{startTime}}"> 14 + <link rel="stylesheet" media="all" href="/yoho-activity-platform/{{version}}/common.css?t={{startTime}}">
  15 + <link rel="stylesheet" media="all" href="/yoho-activity-platform/{{version}}/{{module}}.{{page}}.css?t={{startTime}}">
16 {{/if}} 16 {{/if}}
17 </head> 17 </head>
18 18
@@ -49,8 +49,8 @@ @@ -49,8 +49,8 @@
49 <script src="//{{devHost}}:5001/libs.js"></script> 49 <script src="//{{devHost}}:5001/libs.js"></script>
50 <script src="//{{devHost}}:5001/{{module}}.{{page}}.js"></script> 50 <script src="//{{devHost}}:5001/{{module}}.{{page}}.js"></script>
51 {{^}} 51 {{^}}
52 -<script src="//cdn.yoho.cn/yoho-activity-platform/{{version}}/libs.js?t={{startTime}}"></script>  
53 -<script src="//cdn.yoho.cn/yoho-activity-platform/{{version}}/{{module}}.{{page}}.js?t={{startTime}}"></script> 52 +<script src="/yoho-activity-platform/{{version}}/libs.js?t={{startTime}}"></script>
  53 +<script src="/yoho-activity-platform/{{version}}/{{module}}.{{page}}.js?t={{startTime}}"></script>
54 {{/if}} 54 {{/if}}
55 </body> 55 </body>
56 </html> 56 </html>
@@ -20,7 +20,7 @@ const devInfo = require('./dev-info.js'); @@ -20,7 +20,7 @@ const devInfo = require('./dev-info.js');
20 const distDir = path.join(__dirname, `../public/dist/${config.name}/${config.version}`); 20 const distDir = path.join(__dirname, `../public/dist/${config.name}/${config.version}`);
21 const dist = { 21 const dist = {
22 img: distDir + '/img', 22 img: distDir + '/img',
23 - font: distDir + '/font' 23 + font: distDir + '/fonts'
24 }; 24 };
25 25
26 exports.postcssPlugin = (et) => { 26 exports.postcssPlugin = (et) => {
@@ -78,7 +78,7 @@ module.exports = (env) => { @@ -78,7 +78,7 @@ module.exports = (env) => {
78 entry: getEntries(), 78 entry: getEntries(),
79 output: { 79 output: {
80 path: path.join(__dirname, '../public/bundle'), // absolute path 80 path: path.join(__dirname, '../public/bundle'), // absolute path
81 - filename: '[name].js' 81 + filename: 'js/[name].js'
82 }, 82 },
83 module: { 83 module: {
84 rules: [{ 84 rules: [{
@@ -103,7 +103,7 @@ module.exports = (env) => { @@ -103,7 +103,7 @@ module.exports = (env) => {
103 children: false 103 children: false
104 }, 104 },
105 plugins: [ 105 plugins: [
106 - new ExtractTextPlugin('[name].css'), 106 + new ExtractTextPlugin('css/[name].css'),
107 new HappyPack({ 107 new HappyPack({
108 id: 'js', 108 id: 'js',
109 threadPool: happyThreadPool, 109 threadPool: happyThreadPool,
@@ -14,7 +14,7 @@ module.exports = { @@ -14,7 +14,7 @@ module.exports = {
14 app: 'h5', 14 app: 'h5',
15 appVersion: '5.8.0', // 调用api的版本 15 appVersion: '5.8.0', // 调用api的版本
16 port: 6006, 16 port: 6006,
17 - assetUrl: '//127.0.0.1:5001', 17 + assetUrl: `/yoho-activity-platform/${pkg.version}/`,
18 domains: { 18 domains: {
19 api: 'http://api-test3.yohops.com:9999/', 19 api: 'http://api-test3.yohops.com:9999/',
20 service: 'http://service-test3.yohops.com:9999/', 20 service: 'http://service-test3.yohops.com:9999/',
@@ -75,7 +75,7 @@ module.exports = { @@ -75,7 +75,7 @@ module.exports = {
75 if (isProduction) { 75 if (isProduction) {
76 Object.assign(module.exports, { 76 Object.assign(module.exports, {
77 appName: 'm.yohobuy.com', 77 appName: 'm.yohobuy.com',
78 - assetUrl: `//cdn.yoho.cn/yoho-activity-platform/${pkg.version}/`, 78 + assetUrl: `/yoho-activity-platform/${pkg.version}/`,
79 domains: { 79 domains: {
80 api: 'http://api.yoho.yohoops.org/', 80 api: 'http://api.yoho.yohoops.org/',
81 service: 'http://service.yoho.yohoops.org/', 81 service: 'http://service.yoho.yohoops.org/',
@@ -113,7 +113,7 @@ if (isProduction) { @@ -113,7 +113,7 @@ if (isProduction) {
113 } else if (isTest) { 113 } else if (isTest) {
114 Object.assign(module.exports, { 114 Object.assign(module.exports, {
115 appName: 'm.yohobuy.com for test', 115 appName: 'm.yohobuy.com for test',
116 - assetUrl: `//cdn.yoho.cn/yoho-activity-platform/${pkg.version}/`, 116 + assetUrl: `/yoho-activity-platform/${pkg.version}/`,
117 domains: { 117 domains: {
118 api: process.env.TEST_API || 'http://api-test1.yohops.com:9999/', 118 api: process.env.TEST_API || 'http://api-test1.yohops.com:9999/',
119 service: process.env.TEST_SERVICE || 'http://service-test1.yohops.com:9999/', 119 service: process.env.TEST_SERVICE || 'http://service-test1.yohops.com:9999/',
@@ -11,7 +11,7 @@ @@ -11,7 +11,7 @@
11 <link rel="stylesheet" media="all" href="//{{devHost}}:5001/common.css?t={{startTime}}"> 11 <link rel="stylesheet" media="all" href="//{{devHost}}:5001/common.css?t={{startTime}}">
12 {{^}} 12 {{^}}
13 <link rel="stylesheet" media="all" 13 <link rel="stylesheet" media="all"
14 - href="//cdn.yoho.cn/yoho-activity-platform/{{version}}/common.css?t={{startTime}}"> 14 + href="/yoho-activity-platform/{{version}}/common.css?t={{startTime}}">
15 {{/if}} 15 {{/if}}
16 </head> 16 </head>
17 <body class="nav-md"> 17 <body class="nav-md">
@@ -11,7 +11,7 @@ @@ -11,7 +11,7 @@
11 <link rel="stylesheet" media="all" href="//{{devHost}}:5001/common.css?t={{startTime}}"> 11 <link rel="stylesheet" media="all" href="//{{devHost}}:5001/common.css?t={{startTime}}">
12 {{^}} 12 {{^}}
13 <link rel="stylesheet" media="all" 13 <link rel="stylesheet" media="all"
14 - href="//cdn.yoho.cn/yoho-activity-platform/{{version}}/common.css?t={{startTime}}"> 14 + href="/yoho-activity-platform/{{version}}/common.css?t={{startTime}}">
15 {{/if}} 15 {{/if}}
16 </head> 16 </head>
17 <body class="nav-md"> 17 <body class="nav-md">
@@ -11,7 +11,7 @@ @@ -11,7 +11,7 @@
11 <link rel="stylesheet" media="all" href="//{{devHost}}:5001/common.css?t={{startTime}}"> 11 <link rel="stylesheet" media="all" href="//{{devHost}}:5001/common.css?t={{startTime}}">
12 {{^}} 12 {{^}}
13 <link rel="stylesheet" media="all" 13 <link rel="stylesheet" media="all"
14 - href="//cdn.yoho.cn/yoho-activity-platform/{{version}}/common.css?t={{startTime}}"> 14 + href="/yoho-activity-platform/{{version}}/common.css?t={{startTime}}">
15 {{/if}} 15 {{/if}}
16 </head> 16 </head>
17 <body class="nav-md"> 17 <body class="nav-md">
@@ -11,9 +11,9 @@ @@ -11,9 +11,9 @@
11 <link rel="stylesheet" media="all" href="//{{devHost}}:5001/common.css?t={{startTime}}"> 11 <link rel="stylesheet" media="all" href="//{{devHost}}:5001/common.css?t={{startTime}}">
12 <link rel="stylesheet" media="all" href="//{{devHost}}:5001/{{module}}.{{page}}.css?t={{startTime}}"> 12 <link rel="stylesheet" media="all" href="//{{devHost}}:5001/{{module}}.{{page}}.css?t={{startTime}}">
13 {{^}} 13 {{^}}
14 - <link rel="stylesheet" media="all" href="//cdn.yoho.cn/yoho-activity-platform/{{version}}/common.css?t={{startTime}}"> 14 + <link rel="stylesheet" media="all" href="/yoho-activity-platform/{{version}}/css/common.css?t={{startTime}}">
15 <link rel="stylesheet" media="all" 15 <link rel="stylesheet" media="all"
16 - href="//cdn.yoho.cn/yoho-activity-platform/{{version}}/{{module}}.{{page}}.css?t={{startTime}}"> 16 + href="/yoho-activity-platform/{{version}}/css/{{module}}.{{page}}.css?t={{startTime}}">
17 {{/if}} 17 {{/if}}
18 </head> 18 </head>
19 19
@@ -111,8 +111,8 @@ @@ -111,8 +111,8 @@
111 <script src="//{{devHost}}:5001/libs.js"></script> 111 <script src="//{{devHost}}:5001/libs.js"></script>
112 <script src="//{{devHost}}:5001/{{module}}.{{page}}.js"></script> 112 <script src="//{{devHost}}:5001/{{module}}.{{page}}.js"></script>
113 {{^}} 113 {{^}}
114 -<script src="//cdn.yoho.cn/yoho-activity-platform/{{version}}/libs.js?t={{startTime}}"></script>  
115 -<script src="//cdn.yoho.cn/yoho-activity-platform/{{version}}/{{module}}.{{page}}.js?t={{startTime}}"></script> 114 +<script src="/yoho-activity-platform/{{version}}/libs.js?t={{startTime}}"></script>
  115 +<script src="/yoho-activity-platform/{{version}}/js/{{module}}.{{page}}.js?t={{startTime}}"></script>
116 {{/if}} 116 {{/if}}
117 </body> 117 </body>
118 </html> 118 </html>