1.3.4 • Published 8 months ago

@zzwy/wy-web-cli v1.3.4

Weekly downloads
-
License
ISC
Repository
-
Last release
8 months ago

vite-ifdef

vite条件编译插件,根据开发环境和生产环境,切换不同的代码。

Installation

npm i @zzwy/vite-ifdef

Import

vite.config.js内导入

import conditionalCompile from "@zzwy/vite-ifdef";

export default defineConfig({
  plugins: [
	 vue(),
	 conditionalCompile()
  ]
})

Using

1、html条件编译

<!---@ifdef dev-->
<h1>标题</h1>
<!---@endif-->
<div>001</div>

2、JS条件编译

//@ifdef dev
login(){
    console.log(1)
},
//@endif

3、Css条件编译

/**@ifdef dev**/
login(){
    console.log(1)
},
/**@endif**/
1.3.4

8 months ago

1.3.3

9 months ago

1.3.2

10 months ago

1.2.3

10 months ago

1.3.1

10 months ago

1.3.0

10 months ago

1.2.2

10 months ago

1.2.0

10 months ago

1.1.1

10 months ago

1.1.0

10 months ago

1.1.3

10 months ago

1.2.1

10 months ago

1.1.2

10 months ago

1.0.0

10 months ago