Comments (7)
Could you provide a minimal reproduction repo? It works fine with my case.
from vite-plugin-plain-text.
https://github.com/ninofiliu/vite-plugin-plain-text-bug
pnpm run dev
expected behavior: launches vite + vite-plugin-plain-text
actual behavior: this output
> [email protected] dev /home/nino/c/vite-plugin-plain-text-bug
> vite
failed to load config from /home/nino/c/vite-plugin-plain-text-bug/vite.config.ts
error when starting dev server:
TypeError: plainText is not a function
at file:///home/nino/c/vite-plugin-plain-text-bug/vite.config.ts.timestamp-1674556087799.mjs:5:13
at ModuleJob.run (node:internal/modules/esm/module_job:194:25)
ELIFECYCLE Command failed with exit code 1.
if that helps:
nino@dell~/c/vite-plugin-plain-text-bugmain$ uname -a
Linux dell 5.15.0-58-generic #64-Ubuntu SMP Thu Jan 5 11:43:13 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
nino@dell~/c/vite-plugin-plain-text-bugmain$ node -v
v18.13.0
nino@dell~/c/vite-plugin-plain-text-bugmain$ npm -v
8.19.3
nino@dell~/c/vite-plugin-plain-text-bugmain$ pnpm -v
7.25.1
from vite-plugin-plain-text.
@ninofiliu I found your package.json has the field "type": "module", it specifies that all module importing is treated as ESM.
from vite-plugin-plain-text.
as it should be? I don't really understand
anyway I found a workaround by not using this plugin entirely and natively using vite's ?raw
from vite-plugin-plain-text.
I can declare the CJS exporting and ESM exporting for your issue. But you still have to handle the other CJS-only packages.
from vite-plugin-plain-text.
The latest release v1.3.2 supported your usage.
from vite-plugin-plain-text.
It works indeed, awesome!
from vite-plugin-plain-text.
Related Issues (3)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vite-plugin-plain-text.