Skip to content

Commit a43de10

Browse files
authoredJun 14, 2024··
fix: deprecate default export in favor of named export (#641)
This deprecates the default export in favor of the new named export `sveltePreprocess`. It's done to ensure a better interop between CJS and ESM without resorting to hacks in the future. It also enables people using `"module": "NodeNext"` in their `tsconfig.json` to import without type errors. The sub exports were also adjusted so that the transpiled TS output doesn't include `__importDefault` wrappers, which makes Node's static analysis miss those named exports. Related: #591
1 parent 63bea0d commit a43de10

30 files changed

+119
-66
lines changed
 

‎README.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,10 @@ Writing your own preprocessor for, i.e SCSS is easy enough, but it can be cumber
4141
It is recommended to use with `svelte.config.js` file, located at the project root. For other usage, please refer to [usage documentation](#usage-documentation).
4242

4343
```js
44-
import preprocess from 'svelte-preprocess';
44+
import { sveltePreprocess } from 'svelte-preprocess';
4545

4646
const config = {
47-
preprocess: preprocess({ ... })
47+
preprocess: sveltePreprocess({ ... })
4848
}
4949

5050
export default config;
@@ -121,9 +121,9 @@ _**Note**: needs PostCSS to be installed._
121121
For example, with `@babel/preset-env` your config could be:
122122

123123
```js
124-
import preprocess from 'svelte-preprocess'
124+
import { sveltePreprocess } from 'svelte-preprocess'
125125
...
126-
preprocess: preprocess({
126+
preprocess: sveltePreprocess({
127127
babel: {
128128
presets: [
129129
[
@@ -169,7 +169,7 @@ Which, in a production environment, would turn
169169
into
170170

171171
```svelte
172-
{#if "production" !== 'development'}
172+
{#if 'production' !== 'development'}
173173
<h1>Production environment!</h1>
174174
{/if}
175175
```

‎docs/getting-started.md

+6-9
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ Let's use `svelte-preprocess` in [auto-preprocessing mode](/docs/preprocessing.m
4343

4444
```diff
4545
import svelte from 'rollup-plugin-svelte'
46-
+ import sveltePreprocess from 'svelte-preprocess';
46+
+ import { sveltePreprocess } from 'svelte-preprocess';
4747

4848
const production = !process.env.ROLLUP_WATCH
4949

@@ -88,7 +88,7 @@ After the installation is complete, we still need to configure our PostCSS optio
8888

8989
```diff
9090
import svelte from 'rollup-plugin-svelte'
91-
import sveltePreprocess from 'svelte-preprocess';
91+
import { sveltePreprocess } from 'svelte-preprocess';
9292
+ import typescript from '@rollup/plugin-typescript';
9393

9494
const production = !process.env.ROLLUP_WATCH
@@ -126,9 +126,7 @@ export default {
126126
And we're done! Our components can now be written as:
127127

128128
```html
129-
<template lang="pug">
130-
h1 {name}
131-
</template>
129+
<template lang="pug"> h1 {name} </template>
132130

133131
<script lang="ts">
134132
export let name: string = 'world';
@@ -140,6 +138,7 @@ And we're done! Our components can now be written as:
140138
}
141139
</style>
142140
```
141+
143142
### 3.1 Prepending content
144143

145144
Now we're in need of a SCSS file to hold some variables. Let's assume it's created at `src/styles/variables.scss`.
@@ -153,7 +152,7 @@ As in any SCSS project, we could just `@use './path/to/variables.scss`, but that
153152

154153
```diff
155154
import svelte from 'rollup-plugin-svelte'
156-
import sveltePreprocess from 'svelte-preprocess';
155+
import { sveltePreprocess } from 'svelte-preprocess';
157156

158157
export default {
159158
input: 'src/main.js',
@@ -192,9 +191,7 @@ export default {
192191
Voila! We can now reference a variable from our file without having to explicitly import it.
193192

194193
```html
195-
<template lang="pug">
196-
h1 {name}
197-
</template>
194+
<template lang="pug"> h1 {name} </template>
198195

199196
<script lang="ts">
200197
export let name: string = 'world';

‎docs/migration-guide.md

+6
Original file line numberDiff line numberDiff line change
@@ -97,3 +97,9 @@ In `v4`, your TypeScript code will only be transpiled into JavaScript, with no t
9797
- Node 18 or higher is required now
9898
- When using TypeScript, the minimum required version is now 5.0, `"verbatimModuleSyntax": true` is now required in your `tsconfig.json`, and the mixed imports transpiler (`handleMixedImports`) was removed
9999
- The `preserve` option was removed as it's obsolete
100+
- The default export is deprecated in favor of its new named export:
101+
102+
```diff
103+
- import sveltePreprocess from 'svelte-preprocess';
104+
+ import { sveltePreprocess } from 'svelte-preprocess';
105+
```

‎docs/preprocessing.md

+7-9
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ In auto preprocessing mode, `svelte-preprocess` automatically uses the respectiv
3434

3535
```js
3636
import svelte from 'rollup-plugin-svelte'
37-
import sveltePreprocess from 'svelte-preprocess'
37+
import { sveltePreprocess } from 'svelte-preprocess'
3838

3939
export default {
4040
plugins: [
@@ -49,7 +49,7 @@ As `svelte-preprocess` is just a Svelte preprocessor like any other, it's also p
4949

5050
```js
5151
import svelte from 'rollup-plugin-svelte'
52-
import sveltePreprocess from 'svelte-preprocess'
52+
import { sveltePreprocess } from 'svelte-preprocess'
5353

5454
export default {
5555
plugins: [
@@ -79,7 +79,7 @@ Alongside the options above, you can also configure options of specific preproce
7979

8080
```js
8181
import svelte from 'rollup-plugin-svelte';
82-
import sveltePreprocess from 'svelte-preprocess';
82+
import { sveltePreprocess } from 'svelte-preprocess';
8383

8484
export default {
8585
plugins: [
@@ -110,7 +110,7 @@ It's also possible to create custom preprocessors, taking advantage of the autom
110110

111111
```js
112112
import svelte from 'rollup-plugin-svelte';
113-
import sveltePreprocess from 'svelte-preprocess';
113+
import { sveltePreprocess } from 'svelte-preprocess';
114114

115115
export default {
116116
plugins: [
@@ -146,7 +146,7 @@ To integrate `esbuild` with `svelte-preprocess` we can override the default Type
146146

147147
```js
148148
import svelte from 'rollup-plugin-svelte';
149-
import sveltePreprocess from 'svelte-preprocess';
149+
import { sveltePreprocess } from 'svelte-preprocess';
150150
import { transformSync } from 'esbuild';
151151

152152
export default {
@@ -332,9 +332,7 @@ button.big(type="button" disabled "{...slide.props}") Send
332332
Becomes:
333333

334334
```svelte
335-
<button class="big" type="button" disabled {...slide.props}>
336-
Send
337-
</button>
335+
<button class="big" type="button" disabled {...slide.props}> Send </button>
338336
```
339337

340338
**Svelte Element directives:**
@@ -477,7 +475,7 @@ Allowing to write your component like:
477475
And the result, with a `NODE_ENV = 'production'` would be:
478476

479477
```svelte
480-
{#if "production" !== 'development'}
478+
{#if 'production' !== 'development'}
481479
<h1>Production environment!</h1>
482480
{/if}
483481
```

‎docs/usage.md

+7-8
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@ Write the config in ESM style when you have `"type": "module"` in your `package.
2222

2323
```js
2424
// svelte.config.js
25-
import preprocess from 'svelte-preprocess';
25+
import { sveltePreprocess } from 'svelte-preprocess';
2626

27-
/**
27+
/**
2828
* This will add autocompletion if you're working with SvelteKit
29-
*
30-
* @type {import('@sveltejs/kit').Config}
29+
*
30+
* @type {import('@sveltejs/kit').Config}
3131
*/
3232
const config = {
3333
preprocess: preprocess({
@@ -43,7 +43,7 @@ Write the config in CommonJS style when you don't have `"type": "module"` in you
4343

4444
```js
4545
// svelte.config.js
46-
const sveltePreprocess = require('svelte-preprocess');
46+
const { sveltePreprocess } = require('svelte-preprocess');
4747
module.exports = {
4848
preprocess: sveltePreprocess({
4949
// ...svelte-preprocess options
@@ -52,15 +52,14 @@ module.exports = {
5252
};
5353
```
5454

55-
5655
_Tip: this file can be imported in your bundle config instead of having multiple svelte configurations lying around._
5756

5857
## With `rollup-plugin-svelte`
5958

6059
```js
6160
// rollup.config.js
6261
import svelte from 'rollup-plugin-svelte';
63-
import sveltePreprocess from 'svelte-preprocess'
62+
import { sveltePreprocess } from 'svelte-preprocess'
6463
import { scss, coffeescript, pug } from 'svelte-preprocess'
6564

6665
export default {
@@ -117,7 +116,7 @@ export default {
117116

118117
```js
119118
// ...
120-
import sveltePreprocess from 'svelte-preprocess';
119+
import { sveltePreprocess } from 'svelte-preprocess';
121120

122121
const preprocess = sveltePreprocess({
123122
postcss: true,

‎package.json

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"license": "MIT",
55
"main": "dist/index.js",
66
"types": "dist/index.d.ts",
7+
"type": "commonjs",
78
"exports": {
89
".": {
910
"types": "./dist/index.d.ts",

‎src/index.ts

+16-12
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,22 @@ import { sveltePreprocess } from './autoProcess';
22

33
// default auto processor
44
// crazy es6/cjs export mix for backward compatibility
5-
5+
/** @deprecated Use the named export instead: `import { sveltePreprocess } from 'svelte-preprocess'` */
66
// eslint-disable-next-line no-multi-assign
77
export default exports = module.exports = sveltePreprocess;
88

9-
// stand-alone processors to be included manually */
10-
export { default as pug } from './processors/pug';
11-
export { default as coffeescript } from './processors/coffeescript';
12-
export { default as typescript } from './processors/typescript';
13-
export { default as less } from './processors/less';
14-
export { default as scss, default as sass } from './processors/scss';
15-
export { default as stylus } from './processors/stylus';
16-
export { default as postcss } from './processors/postcss';
17-
export { default as globalStyle } from './processors/globalStyle';
18-
export { default as babel } from './processors/babel';
19-
export { default as replace } from './processors/replace';
9+
// also export auto preprocessor as named export to sidestep default export type issues with "module": "NodeNext" in tsconfig.
10+
// Don't just do export { sveltePreprocess } because the transpiled output is wrong then.
11+
export { sveltePreprocess } from './autoProcess';
12+
13+
// stand-alone processors to be included manually, use their named exports for better transpilation or else node will not detect the named exports properly
14+
export { pug } from './processors/pug';
15+
export { coffeescript } from './processors/coffeescript';
16+
export { typescript } from './processors/typescript';
17+
export { less } from './processors/less';
18+
export { scss, sass } from './processors/scss';
19+
export { stylus } from './processors/stylus';
20+
export { postcss } from './processors/postcss';
21+
export { globalStyle } from './processors/globalStyle';
22+
export { babel } from './processors/babel';
23+
export { replace } from './processors/replace';

‎src/processors/babel.ts

+6-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { prepareContent } from '../modules/prepareContent';
44

55
import type { PreprocessorGroup, Options } from '../types';
66

7-
export default (options?: Options.Babel): PreprocessorGroup => ({
7+
const babel = (options?: Options.Babel): PreprocessorGroup => ({
88
async script(svelteFile) {
99
const { transformer } = await import('../transformers/babel');
1010

@@ -26,3 +26,8 @@ export default (options?: Options.Babel): PreprocessorGroup => ({
2626
};
2727
},
2828
});
29+
30+
// both for backwards compat with old svelte-preprocess versions
31+
// (was only default export once, now is named export because of transpilation causing node not to detect the named exports of 'svelte-preprocess' otherwise)
32+
export default babel;
33+
export { babel };

‎src/processors/coffeescript.ts

+6-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { prepareContent } from '../modules/prepareContent';
44

55
import type { PreprocessorGroup, Options } from '../types';
66

7-
export default (options?: Options.Coffeescript): PreprocessorGroup => ({
7+
const coffeescript = (options?: Options.Coffeescript): PreprocessorGroup => ({
88
async script(svelteFile) {
99
const { transformer } = await import('../transformers/coffeescript');
1010

@@ -36,3 +36,8 @@ export default (options?: Options.Coffeescript): PreprocessorGroup => ({
3636
};
3737
},
3838
});
39+
40+
// both for backwards compat with old svelte-preprocess versions
41+
// (was only default export once, now is named export because of transpilation causing node not to detect the named exports of 'svelte-preprocess' otherwise)
42+
export default coffeescript;
43+
export { coffeescript };

‎src/processors/globalStyle.ts

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type { PreprocessorGroup } from '../types';
22

3-
export default (): PreprocessorGroup => {
3+
const globalStyle = (): PreprocessorGroup => {
44
return {
55
async style({ content, attributes, filename }) {
66
const { transformer } = await import('../transformers/globalStyle');
@@ -13,3 +13,8 @@ export default (): PreprocessorGroup => {
1313
},
1414
};
1515
};
16+
17+
// both for backwards compat with old svelte-preprocess versions
18+
// (was only default export once, now is named export because of transpilation causing node not to detect the named exports of 'svelte-preprocess' otherwise)
19+
export default globalStyle;
20+
export { globalStyle };

‎src/processors/less.ts

+6-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { prepareContent } from '../modules/prepareContent';
44

55
import type { PreprocessorGroup, Options } from '../types';
66

7-
export default (options?: Options.Less): PreprocessorGroup => ({
7+
const less = (options?: Options.Less): PreprocessorGroup => ({
88
async style(svelteFile) {
99
const { transformer } = await import('../transformers/less');
1010
let { content, filename, attributes, lang, dependencies } =
@@ -29,3 +29,8 @@ export default (options?: Options.Less): PreprocessorGroup => ({
2929
};
3030
},
3131
});
32+
33+
// both for backwards compat with old svelte-preprocess versions
34+
// (was only default export once, now is named export because of transpilation causing node not to detect the named exports of 'svelte-preprocess' otherwise)
35+
export default less;
36+
export { less };

‎src/processors/postcss.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { prepareContent } from '../modules/prepareContent';
55
import type { PreprocessorGroup, Options } from '../types';
66

77
/** Adapted from https://github.com/TehShrike/svelte-preprocess-postcss */
8-
export default (options?: Options.Postcss): PreprocessorGroup => ({
8+
const postcss = (options?: Options.Postcss): PreprocessorGroup => ({
99
async style(svelteFile) {
1010
const { transformer } = await import('../transformers/postcss');
1111
let { content, filename, attributes, dependencies } =
@@ -27,3 +27,6 @@ export default (options?: Options.Postcss): PreprocessorGroup => ({
2727
};
2828
},
2929
});
30+
31+
export { postcss };
32+
export default postcss;

‎src/processors/pug.ts

+6-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { transformMarkup } from '../modules/markup';
33

44
import type { Options, PreprocessorGroup } from '../types/index';
55

6-
export default (options?: Options.Pug): PreprocessorGroup => ({
6+
const pug = (options?: Options.Pug): PreprocessorGroup => ({
77
async markup({ content, filename }) {
88
const { transformer } = await import('../transformers/pug');
99

@@ -18,3 +18,8 @@ export default (options?: Options.Pug): PreprocessorGroup => ({
1818
return transformMarkup({ content, filename }, transformer, options);
1919
},
2020
});
21+
22+
// both for backwards compat with old svelte-preprocess versions
23+
// (was only default export once, now is named export because of transpilation causing node not to detect the named exports of 'svelte-preprocess' otherwise)
24+
export default pug;
25+
export { pug };

‎src/processors/replace.ts

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11
import type { PreprocessorGroup, Options } from '../types';
22

3-
export default (options: Options.Replace): PreprocessorGroup => ({
3+
const replace = (options: Options.Replace): PreprocessorGroup => ({
44
async markup({ content, filename }) {
55
const { transformer } = await import('../transformers/replace');
66

77
return transformer({ content, filename, options });
88
},
99
});
10+
11+
// both for backwards compat with old svelte-preprocess versions
12+
// (was only default export once, now is named export because of transpilation causing node not to detect the named exports of 'svelte-preprocess' otherwise)
13+
export default replace;
14+
export { replace };

‎src/processors/scss.ts

+6-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { prepareContent } from '../modules/prepareContent';
44

55
import type { PreprocessorGroup, Options } from '../types';
66

7-
export default (options?: Options.Sass): PreprocessorGroup => ({
7+
const scss = (options?: Options.Sass): PreprocessorGroup => ({
88
async style(svelteFile) {
99
const { transformer } = await import('../transformers/scss');
1010
let { content, filename, attributes, lang, alias, dependencies } =
@@ -37,3 +37,8 @@ export default (options?: Options.Sass): PreprocessorGroup => ({
3737
};
3838
},
3939
});
40+
41+
// both for backwards compat with old svelte-preprocess versions
42+
// (was only default export once, now is named export because of transpilation causing node not to detect the named exports of 'svelte-preprocess' otherwise)
43+
export default scss;
44+
export { scss, scss as sass };

‎src/processors/stylus.ts

+6-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { prepareContent } from '../modules/prepareContent';
44

55
import type { Options, PreprocessorGroup } from '../types';
66

7-
export default (options?: Options.Stylus): PreprocessorGroup => ({
7+
const stylus = (options?: Options.Stylus): PreprocessorGroup => ({
88
async style(svelteFile) {
99
const { transformer } = await import('../transformers/stylus');
1010
let { content, filename, attributes, lang, dependencies } =
@@ -35,3 +35,8 @@ export default (options?: Options.Stylus): PreprocessorGroup => ({
3535
};
3636
},
3737
});
38+
39+
// both for backwards compat with old svelte-preprocess versions
40+
// (was only default export once, now is named export because of transpilation causing node not to detect the named exports of 'svelte-preprocess' otherwise)
41+
export default stylus;
42+
export { stylus };

‎src/processors/typescript.ts

+6-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { prepareContent } from '../modules/prepareContent';
44

55
import type { Options, PreprocessorGroup } from '../types';
66

7-
export default (options?: Options.Typescript): PreprocessorGroup => ({
7+
const typescript = (options?: Options.Typescript): PreprocessorGroup => ({
88
async script(svelteFile) {
99
const { transformer } = await import('../transformers/typescript');
1010
let { content, markup, filename, attributes, lang, dependencies } =
@@ -30,3 +30,8 @@ export default (options?: Options.Typescript): PreprocessorGroup => ({
3030
};
3131
},
3232
});
33+
34+
// both for backwards compat with old svelte-preprocess versions
35+
// (was only default export once, now is named export because of transpilation causing node not to detect the named exports of 'svelte-preprocess' otherwise)
36+
export default typescript;
37+
export { typescript };

‎test/autoProcess/autoProcess.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { describe, it, expect } from 'vitest';
2-
import sveltePreprocess from '../../src';
2+
import { sveltePreprocess } from '../../src';
33
import {
44
preprocess,
55
getFixtureContent,

‎test/autoProcess/externalFiles.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { resolve } from 'path';
22
import { describe, it, expect, afterEach } from 'vitest';
3-
import sveltePreprocess from '../../src';
3+
import { sveltePreprocess } from '../../src';
44
import {
55
preprocess,
66
getFixtureContent,

‎test/autoProcess/markup.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { describe, it, expect, test } from 'vitest';
2-
import sveltePreprocess from '../../src';
2+
import { sveltePreprocess } from '../../src';
33
import { preprocess, getFixtureContent, doesCompileThrow } from '../utils';
44

55
const EXPECTED_MARKUP = getFixtureContent('template.html');

‎test/autoProcess/script.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { describe, it, expect } from 'vitest';
2-
import sveltePreprocess from '../../src';
2+
import { sveltePreprocess } from '../../src';
33
import { preprocess, getFixtureContent } from '../utils';
44

55
const SCRIPT_LANGS: Array<[string, string, any?]> = [

‎test/autoProcess/sourceMaps.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { describe, it, expect, vi, afterAll } from 'vitest';
2-
import sveltePreprocess from '../../src';
2+
import { sveltePreprocess } from '../../src';
33
import { preprocess } from '../utils';
44
import { transformer as babelTransformer } from '../../src/transformers/babel';
55
import { transformer as coffeeTransformer } from '../../src/transformers/coffeescript';

‎test/autoProcess/style.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { describe, it, expect } from 'vitest';
2-
import sveltePreprocess from '../../src';
2+
import { sveltePreprocess } from '../../src';
33
import { preprocess, getFixtureContent, CSS_PATTERN } from '../utils';
44

55
const STYLE_LANGS: Array<[string, string]> = [

‎test/transformers/babel.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { describe, it, expect } from 'vitest';
2-
import sveltePreprocess from '../../src';
2+
import { sveltePreprocess } from '../../src';
33
import { preprocess } from '../utils';
44

55
const BABEL_CONFIG = {

‎test/transformers/less.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { resolve } from 'path';
22
import { describe, it, expect } from 'vitest';
3-
import sveltePreprocess from '../../src';
3+
import { sveltePreprocess } from '../../src';
44
import { preprocess } from '../utils';
55

66
describe('transformer - less', () => {

‎test/transformers/postcss.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/* eslint-disable @typescript-eslint/no-require-imports */
44
import { resolve } from 'path';
55
import { test, expect, vi } from 'vitest';
6-
import sveltePreprocess from '../../src';
6+
import { sveltePreprocess } from '../../src';
77
import { preprocess, spyConsole } from '../utils';
88
import { transformer } from '../../src/transformers/postcss';
99

‎test/transformers/pug.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { resolve } from 'path';
22
import { describe, it, expect } from 'vitest';
3-
import sveltePreprocess from '../../src';
3+
import { sveltePreprocess } from '../../src';
44
import { preprocess } from '../utils';
55

66
describe('transformer - pug', () => {

‎test/transformers/scss.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
import { resolve } from 'path';
55
import { describe, it, expect } from 'vitest';
6-
import sveltePreprocess from '../../src';
6+
import { sveltePreprocess } from '../../src';
77
import { preprocess } from '../utils';
88
import { transformer } from '../../src/transformers/scss';
99

‎test/transformers/stylus.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { resolve } from 'path';
22
import { describe, it, expect } from 'vitest';
3-
import sveltePreprocess from '../../src';
3+
import { sveltePreprocess } from '../../src';
44
import { preprocess } from '../utils';
55

66
describe('transformer - stylus', () => {

‎test/transformers/typescript.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { resolve } from 'path';
22
import { compile } from 'svelte/compiler';
33
import { describe, it, expect } from 'vitest';
4-
import sveltePreprocess from '../../src';
4+
import { sveltePreprocess } from '../../src';
55
import { loadTsconfig } from '../../src/transformers/typescript';
66
import {
77
preprocess,

0 commit comments

Comments
 (0)
Please sign in to comment.