Skip to content

Commit 0bcc1be

Browse files
Copilotfregante
andcommitted
Simplify vite config and move URLs to fixtures
- Simplified demo/vite.config.js to simple object (not callback) - Moved urls.js to fixtures/urls.js - Updated imports in index.test.js and demo/index.js Co-authored-by: fregante <1402241+fregante@users.noreply.github.com>
1 parent 0f323e1 commit 0bcc1be

4 files changed

Lines changed: 8 additions & 19 deletions

File tree

demo/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import shortenUrl from '../index.js';
2-
import {urls} from '../urls.js';
2+
import {urls} from '../fixtures/urls.js';
33

44
const currentLocation = 'https://github.com/fregante/shorten-repo-url/issue/1';
55

demo/vite.config.js

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,9 @@
11
import {defineConfig} from 'vite';
22

3-
export default defineConfig(({command}) => {
4-
if (command === 'build') {
5-
return {
6-
base: '',
7-
build: {
8-
outDir: 'dist',
9-
emptyOutDir: true,
10-
},
11-
};
12-
}
13-
14-
// Default config for test/serve
15-
return {
16-
test: {
17-
exclude: ['**/node_modules/**', '**/dist/**'],
18-
},
19-
};
3+
export default defineConfig({
4+
base: '',
5+
build: {
6+
outDir: 'dist',
7+
emptyOutDir: true,
8+
},
209
});
File renamed without changes.

index.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import {test, expect} from 'vitest';
22
import {Window} from 'happy-dom';
3-
import {urls} from './urls.js';
3+
import {urls} from './fixtures/urls.js';
44
import shortenUrl, {applyToLink} from './index.js';
55

66
const currentLocation = 'https://github.com/fregante/shorten-repo-url/issue/1';

0 commit comments

Comments
 (0)