Authored by ccbikai(👎🏻🍜)

静态资源打包优化

... ... @@ -25,9 +25,9 @@
{{/if}}
{{#if devEnv}}
{{#if shopPage}}
<link rel="stylesheet" href="//{{devHost}}:5001/css/shop.css">
<link rel="stylesheet" href="//{{devHost}}:5001/bundle/shop.css">
{{^}}
<link rel="stylesheet" href="//{{devHost}}:5001/css/index.css">
<link rel="stylesheet" href="//{{devHost}}:5001/bundle/index.css">
{{/if}}
{{^}}
{{#if shopPage}}
... ...
... ... @@ -92,8 +92,8 @@ const postcssPlugin = (et) => {
Object.assign(sprites, {
basePath: 'img/',
stylesheetPath: 'css/',
spritePath: 'img/'
stylesheetPath: 'bundle/',
spritePath: 'bundle/'
});
}
... ... @@ -145,11 +145,11 @@ gulp.task('dist', ['ge'], () => {
// postcss compile in dev
gulp.task('postcss-dev', () => {
return gulp.src(['scss/index.css', 'scss/shop.css'])
return gulp.src(['scss/shop.css', 'scss/index.css'])
.pipe(sourcemaps.init())
.pipe(postcss(postcssPlugin(env.dev)))
.pipe(sourcemaps.write('.'))
.pipe(gulp.dest('css/'));
.pipe(gulp.dest('bundle/'));
});
// postcss file watch
... ...