Authored by xuqi

wap layout

... ... @@ -14,9 +14,19 @@
<link rel="dns-prefetch" href="//static.yohobuy.com">
<link rel="dns-prefetch" href="//img12.static.yhbimg.com">
<link rel="dns-prefetch" href="//img13.static.yhbimg.com">
{{#if devEnv}}
<link rel="stylesheet" href="//localhost:3000/css/index.css">
{{^}}
<link rel="stylesheet" href="//cdn.yoho.cn/mYohobuy/{{version}}/index.css">
{{/if}}
</head>
<body>
{{> header}}
{{{body}}}
{{#if devEnv}}
<script src="//localhost:8000/{{module}}.{{page}}.js"></script>
{{^}}
<script src="//cdn.yoho.cn/{{module}}.{{page}}.js"></script>
{{/if}}
</body>
</html>
\ No newline at end of file
... ...
No preview for this file type
... ... @@ -105,6 +105,9 @@ const postcssPlugin = (et) => {
return plugins;
};
// default
gulp.task('default', ['postcss-dev', 'postcss-watch', 'webpack-dev-server']);
// postcss compile in dev
gulp.task('postcss-dev', () => {
return gulp.src('scss/index.css')
... ... @@ -143,25 +146,25 @@ gulp.task('postcss', ['assets'], () => {
});
// webpack dev server
// gulp.task('webpack-dev-server', () => {
// var devConfig = Object.assign({}, webpackConfig, {
// devtool: 'eval',
// debug: true
// });
// new webpackDevServer(webpack(devConfig), {
// contentBase: '.',
// publicPath: '/',
// stats: {
// colors: true
// }
// }).listen(8000, 'localhost', (err) => {
// if (err) {
// throw new gutil.PluginError('webpack-dev-server', err);
// }
// gutil.log('[webpack-serve]', 'http://localhost:8000/');
// });
// });
gulp.task('webpack-dev-server', () => {
var devConfig = Object.assign({}, webpackConfig, {
debug: true
});
new webpackDevServer(webpack(devConfig), {
contentBase: '.',
publicPath: '//localhost:8000/',
hot: true,
stats: {
colors: true
}
}).listen(8000, 'localhost', (err) => {
if (err) {
throw new gutil.PluginError('webpack-dev-server', err);
}
gutil.log('[webpack-serve]', 'http://localhost:8000/');
});
});
// webpack compile in pro
gulp.task('webpack', () => {
... ...
... ... @@ -27,7 +27,7 @@ ls(__dirname + '/js/**/*.page.js').forEach((f) => {
module.exports = {
entry: entries,
output: {
path: './bundle',
path: path.join(__dirname, 'bundle'), //absolute path
filename: '[name].js'
}
};
\ No newline at end of file
... ...