File tree Expand file tree Collapse file tree 3 files changed +34
-23
lines changed Expand file tree Collapse file tree 3 files changed +34
-23
lines changed Original file line number Diff line number Diff line change 11# Changelog
22
3+ ## 2.1.15
4+
5+ - [ feat] cli option --skip-compile for skip webpack compile
6+
37## 2.1.14
48
59- [ feat] support postcssrc/postcss.config.js #2952
Original file line number Diff line number Diff line change 88 . option ( '--config <config>' , 'use custom config' )
99 . option ( '--analyzer' , '开启构建分析' )
1010 . option ( '--analyzer-port' , '设置分析端口号' )
11+ . option ( '--skip-compile' , 'skip webpack compile, excute hooks for component compile' )
1112 . parse ( process . argv ) ;
1213
1314( async ( ) => {
Original file line number Diff line number Diff line change @@ -43,28 +43,34 @@ module.exports = async function (context) {
4343 }
4444 }
4545
46- // empty output path
47- fse . emptyDirSync ( webpackConfig . output . path ) ;
48- return new Promise ( ( resolve , reject ) => {
49- webpack ( webpackConfig , ( error , stats ) => {
50- if ( error ) {
51- return reject ( error ) ;
52- }
53- console . log (
54- stats . toString ( {
55- colors : true ,
56- chunks : false ,
57- children : false ,
58- modules : false ,
59- chunkModules : false ,
60- } )
61- ) ;
62- if ( stats . hasErrors ( ) ) {
63- return reject ( new Error ( 'webpack compiled failed.' ) ) ;
64- }
65- log . info ( 'ICE build finished' ) ;
66- applyHook ( 'afterBuild' , stats ) ;
67- resolve ( ) ;
46+ const skipCompile = commandArgs . skipCompile || process . env . SKIP_COMPILE ;
47+ if ( skipCompile ) {
48+ applyHook ( 'afterBuild' , { } ) ;
49+ return Promise . resolve ( ) ;
50+ } else {
51+ // empty output path
52+ fse . emptyDirSync ( webpackConfig . output . path ) ;
53+ return new Promise ( ( resolve , reject ) => {
54+ webpack ( webpackConfig , ( error , stats ) => {
55+ if ( error ) {
56+ return reject ( error ) ;
57+ }
58+ console . log (
59+ stats . toString ( {
60+ colors : true ,
61+ chunks : false ,
62+ children : false ,
63+ modules : false ,
64+ chunkModules : false ,
65+ } ) ,
66+ ) ;
67+ if ( stats . hasErrors ( ) ) {
68+ return reject ( new Error ( 'webpack compiled failed.' ) ) ;
69+ }
70+ log . info ( 'ICE build finished' ) ;
71+ applyHook ( 'afterBuild' , stats ) ;
72+ resolve ( ) ;
73+ } ) ;
6874 } ) ;
69- } ) ;
75+ }
7076} ;
You can’t perform that action at this time.
0 commit comments