@vitarx/plugin-vite 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -27,6 +27,7 @@ export interface VitePluginVitarxOptions {
27
27
  * - 支持 className 转 class(仅原生 HTML 元素)
28
28
  *
29
29
  * @param options - 插件配置选项。
30
+ * @param [options.transformClassNameToClass=false] - 支持className。
30
31
  * @returns - vite插件对象。
31
32
  */
32
33
  export default function vitarx(options?: VitePluginVitarxOptions): Plugin;
package/dist/index.js CHANGED
@@ -15,6 +15,7 @@ const IS_V8 = version.startsWith('8');
15
15
  * - 支持 className 转 class(仅原生 HTML 元素)
16
16
  *
17
17
  * @param options - 插件配置选项。
18
+ * @param [options.transformClassNameToClass=false] - 支持className。
18
19
  * @returns - vite插件对象。
19
20
  */
20
21
  export default function vitarx(options) {
@@ -25,10 +26,9 @@ export default function vitarx(options) {
25
26
  let viteTransform;
26
27
  return {
27
28
  name: 'vite-plugin-vitarx',
28
- enforce: 'pre',
29
29
  config(config, env) {
30
30
  isDEV = env.command === 'serve' && !env.isPreview;
31
- isSSR = env.isSsrBuild === true;
31
+ isSSR = env.isSsrBuild === true || !!config.build?.ssr;
32
32
  return {
33
33
  define: {
34
34
  __VITARX_DEV__: JSON.stringify(isDEV),
@@ -45,10 +45,6 @@ export default function vitarx(options) {
45
45
  };
46
46
  },
47
47
  async configResolved(config) {
48
- if (!isSSR) {
49
- isSSR = !!config.build?.ssr;
50
- config.define['__VITARX_SSR__'] = JSON.stringify(isSSR);
51
- }
52
48
  compileOptions = {
53
49
  dev: isDEV,
54
50
  ssr: isSSR,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vitarx/plugin-vite",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "The official plugin for Vitarx support in Vite.",
5
5
  "author": "ZhuChongLin <8210856@qq.com>",
6
6
  "license": "MIT",
@@ -67,6 +67,6 @@
67
67
  "build": "vitest run && rimraf dist && tsc -p tsconfig.build.json",
68
68
  "test": "vitest run",
69
69
  "typecheck": "tsc --noEmit",
70
- "release": "release-cli"
70
+ "release": "npx change-push"
71
71
  }
72
72
  }