xml-model 1.1.2 → 1.2.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xml-model",
3
- "version": "1.1.2",
3
+ "version": "1.2.0",
4
4
  "description": "allows transparent XML <-> Object conversion in typescript",
5
5
  "license": "MIT",
6
6
  "author": "MathisTLD",
@@ -1,4 +1,5 @@
1
1
  import { Plugin } from 'vite';
2
+ import { RollupTypescriptOptions } from '@rollup/plugin-typescript';
2
3
  /**
3
4
  * When Building, class names are changed but the library relies on them
4
5
  * so they need to be preserved
@@ -6,7 +7,12 @@ import { Plugin } from 'vite';
6
7
  */
7
8
  export declare function FixClassNames(): Plugin;
8
9
  type RTTIPluginOptions = {
9
- tsconfig?: string;
10
+ /**
11
+ * options for @rollup/plugin-typescript
12
+ *
13
+ * Plugin might not work if you override the `transformers` property as these options are assigned and not deep merged
14
+ */
15
+ typescript?: RollupTypescriptOptions;
10
16
  /** Files where the rtti transformer should be applied
11
17
  *
12
18
  * If not set, will include every files by default
@@ -21,13 +21,12 @@ function FixClassNames() {
21
21
  };
22
22
  }
23
23
  function TypescriptRTTI(options = {}) {
24
- const { tsconfig, include, exclude, debug = false } = options;
24
+ const { typescript: rollupPluginTypescriptOptions, include, exclude, debug = false } = options;
25
25
  const doTransform = !include && !exclude ? () => true : (path) => {
26
26
  if (exclude?.test(path)) return false;
27
27
  return include ? include.test(path) : true;
28
28
  };
29
29
  return typescript({
30
- tsconfig,
31
30
  transformers: {
32
31
  before: [
33
32
  {
@@ -49,7 +48,8 @@ function TypescriptRTTI(options = {}) {
49
48
  ]
50
49
  },
51
50
  // set declaration to `false` to let plugin dts handle the declarations
52
- declaration: false
51
+ declaration: false,
52
+ ...rollupPluginTypescriptOptions
53
53
  });
54
54
  }
55
55
  function XMLModelVitePlugin(options = {}) {