|
| 1 | +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html |
| 2 | + |
| 3 | +exports[`comprehensive transformation > should transform complex tsup config > code 1`] = ` |
| 4 | +"import { defineConfig } from 'tsdown' |
| 5 | +import icons from 'unplugin-icons/rolldown' |
| 6 | +
|
| 7 | +export default defineConfig({ |
| 8 | + entry: ['src/index.ts'], |
| 9 | + format: ['esm', 'cjs'], |
| 10 | + plugins: [icons()], |
| 11 | + unbundle: true, |
| 12 | + copy: 'public', |
| 13 | + splitting: true, |
| 14 | + metafile: true, |
| 15 | + clean: false, |
| 16 | + dts: false, |
| 17 | + target: false, |
| 18 | +})" |
| 19 | +`; |
| 20 | + |
| 21 | +exports[`comprehensive transformation > should transform complex tsup config > warnings 1`] = ` |
| 22 | +[ |
| 23 | + "The \`splitting\` option is currently unsupported in tsdown. Code splitting is always enabled and cannot be disabled.", |
| 24 | + "The \`metafile\` option is not available in tsdown. Consider using Vite DevTools as an alternative.", |
| 25 | +] |
| 26 | +`; |
| 27 | + |
| 28 | +exports[`default values > should add clean: false when not present > code 1`] = ` |
| 29 | +"export default { |
| 30 | + entry: ['src/index.ts'], |
| 31 | + format: 'cjs', |
| 32 | + clean: false, |
| 33 | + dts: false, |
| 34 | + target: false, |
| 35 | +}" |
| 36 | +`; |
| 37 | + |
| 38 | +exports[`default values > should add dts: false when not present > code 1`] = ` |
| 39 | +"export default { |
| 40 | + entry: ['src/index.ts'], |
| 41 | + format: 'cjs', |
| 42 | + clean: false, |
| 43 | + dts: false, |
| 44 | + target: false, |
| 45 | +}" |
| 46 | +`; |
| 47 | + |
| 48 | +exports[`default values > should add format: "cjs" when not present > code 1`] = ` |
| 49 | +"export default { |
| 50 | + entry: ['src/index.ts'], |
| 51 | + format: 'cjs', |
| 52 | + clean: false, |
| 53 | + dts: false, |
| 54 | + target: false, |
| 55 | +}" |
| 56 | +`; |
| 57 | + |
| 58 | +exports[`default values > should add target: false when not present > code 1`] = ` |
| 59 | +"export default { |
| 60 | + entry: ['src/index.ts'], |
| 61 | + format: 'cjs', |
| 62 | + clean: false, |
| 63 | + dts: false, |
| 64 | + target: false, |
| 65 | +}" |
| 66 | +`; |
| 67 | + |
| 68 | +exports[`default values > should not add format when present > code 1`] = ` |
| 69 | +"export default { |
| 70 | + format: ['esm', 'cjs'], |
| 71 | + clean: false, |
| 72 | + dts: false, |
| 73 | + target: false, |
| 74 | +}" |
| 75 | +`; |
| 76 | + |
| 77 | +exports[`option transformations > bundle: false should transform to unbundle: true > code 1`] = ` |
| 78 | +"export default { |
| 79 | + unbundle: true, |
| 80 | + format: 'cjs', |
| 81 | + clean: false, |
| 82 | + dts: false, |
| 83 | + target: false, |
| 84 | +}" |
| 85 | +`; |
| 86 | + |
| 87 | +exports[`option transformations > bundle: true should be removed > code 1`] = ` |
| 88 | +"export default { |
| 89 | + entry: ['src/index.ts'], |
| 90 | + format: 'cjs', |
| 91 | + clean: false, |
| 92 | + dts: false, |
| 93 | + target: false, |
| 94 | +}" |
| 95 | +`; |
| 96 | + |
| 97 | +exports[`option transformations > entryPoints should transform to entry > code 1`] = ` |
| 98 | +"export default { |
| 99 | + entry: ['src/index.ts'], |
| 100 | + format: 'cjs', |
| 101 | + clean: false, |
| 102 | + dts: false, |
| 103 | + target: false, |
| 104 | +}" |
| 105 | +`; |
| 106 | + |
| 107 | +exports[`option transformations > publicDir should transform to copy > code 1`] = ` |
| 108 | +"export default { |
| 109 | + copy: 'public', |
| 110 | + format: 'cjs', |
| 111 | + clean: false, |
| 112 | + dts: false, |
| 113 | + target: false, |
| 114 | +}" |
| 115 | +`; |
| 116 | + |
| 117 | +exports[`option transformations > removeNodeProtocol should transform to nodeProtocol: "strip" > code 1`] = ` |
| 118 | +"export default { |
| 119 | + nodeProtocol: 'strip', |
| 120 | + format: 'cjs', |
| 121 | + clean: false, |
| 122 | + dts: false, |
| 123 | + target: false, |
| 124 | +}" |
| 125 | +`; |
| 126 | + |
| 127 | +exports[`option transformations > splitting should emit warning > code 1`] = ` |
| 128 | +"export default { |
| 129 | + splitting: true, |
| 130 | + format: 'cjs', |
| 131 | + clean: false, |
| 132 | + dts: false, |
| 133 | + target: false, |
| 134 | +}" |
| 135 | +`; |
| 136 | + |
| 137 | +exports[`option transformations > splitting should emit warning > warnings 1`] = ` |
| 138 | +[ |
| 139 | + "The \`splitting\` option is currently unsupported in tsdown. Code splitting is always enabled and cannot be disabled.", |
| 140 | +] |
| 141 | +`; |
| 142 | + |
| 143 | +exports[`plugin migrations > esbuildPlugins should transform to plugins > code 1`] = ` |
| 144 | +"export default { |
| 145 | + plugins: [somePlugin()], |
| 146 | + format: 'cjs', |
| 147 | + clean: false, |
| 148 | + dts: false, |
| 149 | + target: false, |
| 150 | +}" |
| 151 | +`; |
| 152 | + |
| 153 | +exports[`plugin migrations > plugins option should emit warning (experimental in tsup) > code 1`] = ` |
| 154 | +"export default { |
| 155 | + plugins: [somePlugin()], |
| 156 | + format: 'cjs', |
| 157 | + clean: false, |
| 158 | + dts: false, |
| 159 | + target: false, |
| 160 | +}" |
| 161 | +`; |
| 162 | + |
| 163 | +exports[`plugin migrations > plugins option should emit warning (experimental in tsup) > warnings 1`] = ` |
| 164 | +[ |
| 165 | + "The \`plugins\` option in tsup is experimental. Please migrate your plugins manually.", |
| 166 | +] |
| 167 | +`; |
| 168 | + |
| 169 | +exports[`plugin migrations > unplugin-*/esbuild should transform to unplugin-*/rolldown > code 1`] = ` |
| 170 | +"import icons from 'unplugin-icons/rolldown' |
| 171 | +import vue from 'unplugin-vue/rolldown' |
| 172 | +
|
| 173 | +export default { |
| 174 | + plugins: [icons(), vue()], |
| 175 | + format: 'cjs', |
| 176 | + clean: false, |
| 177 | + dts: false, |
| 178 | + target: false, |
| 179 | +}" |
| 180 | +`; |
| 181 | + |
| 182 | +exports[`warning options > cjsInterop should emit warning > code 1`] = ` |
| 183 | +"export default { |
| 184 | + cjsDefault: true, |
| 185 | + format: 'cjs', |
| 186 | + clean: false, |
| 187 | + dts: false, |
| 188 | + target: false, |
| 189 | +}" |
| 190 | +`; |
| 191 | + |
| 192 | +exports[`warning options > experimentalDts should emit warning > code 1`] = ` |
| 193 | +"export default { |
| 194 | + experimentalDts: true, |
| 195 | + format: 'cjs', |
| 196 | + clean: false, |
| 197 | + dts: false, |
| 198 | + target: false, |
| 199 | +}" |
| 200 | +`; |
| 201 | + |
| 202 | +exports[`warning options > experimentalDts should emit warning > warnings 1`] = ` |
| 203 | +[ |
| 204 | + "The \`experimentalDts\` option is not supported in tsdown. Use the \`dts\` option instead.", |
| 205 | +] |
| 206 | +`; |
| 207 | + |
| 208 | +exports[`warning options > injectStyle should emit warning (not implemented) > code 1`] = ` |
| 209 | +"export default { |
| 210 | + injectStyle: true, |
| 211 | + format: 'cjs', |
| 212 | + clean: false, |
| 213 | + dts: false, |
| 214 | + target: false, |
| 215 | +}" |
| 216 | +`; |
| 217 | + |
| 218 | +exports[`warning options > injectStyle should emit warning (not implemented) > warnings 1`] = ` |
| 219 | +[ |
| 220 | + "The \`injectStyle\` option has not yet been implemented in tsdown.", |
| 221 | +] |
| 222 | +`; |
| 223 | + |
| 224 | +exports[`warning options > legacyOutput should emit warning > code 1`] = ` |
| 225 | +"export default { |
| 226 | + legacyOutput: true, |
| 227 | + format: 'cjs', |
| 228 | + clean: false, |
| 229 | + dts: false, |
| 230 | + target: false, |
| 231 | +}" |
| 232 | +`; |
| 233 | + |
| 234 | +exports[`warning options > legacyOutput should emit warning > warnings 1`] = ` |
| 235 | +[ |
| 236 | + "The \`legacyOutput\` option is not supported in tsdown.", |
| 237 | +] |
| 238 | +`; |
| 239 | + |
| 240 | +exports[`warning options > metafile should emit warning (use Vite DevTools) > code 1`] = ` |
| 241 | +"export default { |
| 242 | + metafile: true, |
| 243 | + format: 'cjs', |
| 244 | + clean: false, |
| 245 | + dts: false, |
| 246 | + target: false, |
| 247 | +}" |
| 248 | +`; |
| 249 | + |
| 250 | +exports[`warning options > metafile should emit warning (use Vite DevTools) > warnings 1`] = ` |
| 251 | +[ |
| 252 | + "The \`metafile\` option is not available in tsdown. Consider using Vite DevTools as an alternative.", |
| 253 | +] |
| 254 | +`; |
| 255 | + |
| 256 | +exports[`warning options > swc should emit warning (use oxc) > code 1`] = ` |
| 257 | +"export default { |
| 258 | + swc: true, |
| 259 | + format: 'cjs', |
| 260 | + clean: false, |
| 261 | + dts: false, |
| 262 | + target: false, |
| 263 | +}" |
| 264 | +`; |
| 265 | + |
| 266 | +exports[`warning options > swc should emit warning (use oxc) > warnings 1`] = ` |
| 267 | +[ |
| 268 | + "The \`swc\` option is not supported in tsdown. Please use oxc instead.", |
| 269 | +] |
| 270 | +`; |
0 commit comments