Skip to content

Commit ba26f9f

Browse files
authored
Add support for Vite 5 (#9)
* Add support vor Vite 5 * Try to fix paths * Make noBundle imports relative instead of hacky * Update README
1 parent 96e140f commit ba26f9f

26 files changed

+3521
-1875
lines changed

.github/workflows/npm-publish.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,10 @@ jobs:
1111
- uses: actions/checkout@v3
1212
- uses: actions/setup-node@v3
1313
with:
14-
node-version: 16
14+
node-version: 20
1515
registry-url: https://registry.npmjs.org/
1616
- run: npm install
17+
- run: npm test
1718
- run: npm run build
1819
- run: npm publish
1920
env:

.github/workflows/test.yml

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: Run tests
2+
3+
on: [pull_request]
4+
5+
jobs:
6+
test:
7+
runs-on: ubuntu-latest
8+
9+
steps:
10+
- uses: actions/checkout@v3
11+
- uses: actions/setup-node@v3
12+
with:
13+
node-version: 20
14+
registry-url: https://registry.npmjs.org/
15+
- run: npm install
16+
- run: npm test

README.md

+10-5
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
<div align="center">
66

7-
![](https://i.imgur.com/whutZeK.png)
7+
![screenshot](https://i.imgur.com/whutZeK.png)
88

99
</div>
1010

@@ -23,6 +23,8 @@ some of those gaps. 🚀
2323

2424
![npm](https://img.shields.io/static/v1?style=for-the-badge&message=npm&color=CB3837&logo=npm&logoColor=FFFFFF&label=)
2525

26+
> From v4, `vite-plugin-no-bundle` requires **Vite 5**.
27+
2628
This plugin is designed to work with Vite in a development environment using
2729
Node.js. You can install this package using npm, [Yarn], or [pnpm] using a
2830
command similar to this example for npm:
@@ -57,7 +59,7 @@ export default defineConfig({
5759

5860
Here's an example project tree using ☝ the example `vite.config.ts` from above:
5961

60-
```
62+
```text
6163
.
6264
├── dist/
6365
│ ├── index.js
@@ -99,7 +101,7 @@ interface VitePluginNoBundleOptions {
99101

100102
- **`internal`:** One or more [globs] for matching files that should **not** be
101103
automatically marked as external. This can be used to tell the plugin to
102-
**not** handle certain files and leave them up to other plugins & resolvers.
104+
**not** handle certain files and leave them up to other plugins and resolvers.
103105

104106
- **`root`:** Exposes [`output.preserveModulesRoot`], which controls which part
105107
of the full path to exclude when putting files into the `dist/` folder. Make
@@ -143,12 +145,16 @@ Another good use-case is serving individual files via an HTTP server. Sometimes
143145
you just want a plain TS ➡️ JS file conversion (with some extra features). This
144146
plugin lets you do just that, no magic required. 🧙‍♂️
145147

148+
📂 **[Browse Sample Configurations](./samples)** - For practical examples,
149+
explore the `samples` folder.
150+
146151
## Development
147152

148153
![TypeScript](https://img.shields.io/static/v1?style=for-the-badge&message=TypeScript&color=3178C6&logo=TypeScript&logoColor=FFFFFF&label=)
149154

150155
This is a fairly basic Vite plugin. The only compilation step is to run
151-
`npm run build` which uses [tsup].
156+
`npm run build` which uses [tsup]. Sample configurations serve as test
157+
cases for different plugin scenarios and can be run using `npm test`.
152158

153159
If you're interested in learning more about Vite plugins and how they work,
154160
check out the [Plugin API | Vite] page!
@@ -161,7 +167,6 @@ check out the [Plugin API | Vite] page!
161167
[vitejs/vite#4454]: https://github.com/vitejs/vite/issues/4454
162168
[tsup]: https://github.com/egoist/tsup#readme
163169
[Plugin API | Vite]: https://vitejs.dev/guide/api-plugin.html
164-
[@ManBearTM]: https://github.com/ManBearTM
165170
[yarn]: https://yarnpkg.com/
166171
[pnpm]: https://pnpm.io/
167172
<!-- prettier-ignore-end -->

0 commit comments

Comments
 (0)