Skip to content

Commit 9ecafea

Browse files
committed
fix(gulp): 将编译报错抛出
1 parent 5e06144 commit 9ecafea

File tree

1 file changed

+24
-21
lines changed

1 file changed

+24
-21
lines changed

packages/theme-saas/build/gulp-dist.js

Lines changed: 24 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -40,27 +40,30 @@ const note = fs.readFileSync('../src/index.less', { encoding: 'utf-8' }).match(/
4040
fs.writeFileSync('../src/index.less', `${note}\n\n${importStr}`)
4141

4242
function compile() {
43-
const tailwindcss = require('tailwindcss')
44-
45-
const task = gulp
46-
.src(lessFiles, { since: gulp.lastRun(compile) })
47-
.pipe(svgInline(svgInlineOption))
48-
.pipe(less())
49-
.pipe(postcss([tailwindcss('../tailwind.config.js'), require('autoprefixer')]))
50-
.pipe(
51-
prefixer({
52-
borwsers: ['last 1 version', '> 1%', 'not ie <= 8'],
53-
cascade: true,
54-
remove: true
55-
})
56-
)
57-
.pipe(svgInline(svgInlineOption))
58-
.pipe(cssmin())
59-
.pipe(gulp.dest(dist))
60-
61-
if (syncToTinyVueProject) task.pipe(gulp.dest(devDist))
62-
63-
return task
43+
try {
44+
const tailwindcss = require('tailwindcss')
45+
46+
const task = gulp
47+
.src(lessFiles, { since: gulp.lastRun(compile) })
48+
.pipe(svgInline(svgInlineOption))
49+
.pipe(less())
50+
.pipe(postcss([tailwindcss('../tailwind.config.js'), require('autoprefixer')]))
51+
.pipe(
52+
prefixer({
53+
borwsers: ['last 1 version', '> 1%', 'not ie <= 8'],
54+
cascade: true,
55+
remove: true
56+
})
57+
)
58+
.pipe(svgInline(svgInlineOption))
59+
.pipe(cssmin())
60+
.pipe(gulp.dest(dist))
61+
62+
if (syncToTinyVueProject) task.pipe(gulp.dest(devDist))
63+
return task
64+
} catch (e) {
65+
console.error('111111~~~~', e)
66+
}
6467
}
6568

6669
gulp.task('compile', compile)

0 commit comments

Comments
 (0)