Comments (9)
@drzraf I'm afraid you'll have to distill this issue a bit further before we can triage it. Please identify what isn't working within @rollup/plugin-inject, or rollup-plugin-commonjs. Once you have it narrowed down, we'll be able to help you further.
from plugins.
@drzraf please see the previous reply. If that's something you're willing to tackle, we'll be happy to reopen this issue.
from plugins.
I can't go further than what I already provided. Sorry to see such a high entry bar to bugfixes
from plugins.
Everyone here volunteers their time to work on the project. When users come here with issues that involve complex configurations or reproductions, we ask that they distill the config or repro down to a simple form that highlights the issue faced. We simply don't have the time or resources to deep dive nuanced configs. That's why we ask for minimal reproductions in the issue template.
I'm sorry that you can't reduce your reproduction further, and that you feel that triage is creating a high entry bar. Perhaps someone else who can will pick this up in the future.
from plugins.
@shellscape i take a quick look at provided repro and it seems to be pretty minimal
from plugins.
@Andarist We've asked for the conflict between the two plugins to be distilled further in an earlier reply.
from plugins.
I think the root cause here is quite simple - I've stumbled upon a really similar issue lately while debugging it.
Problem is that @rollup/plugin-inject
injects import statements, so it makes automatically a module out of the given file, even if it's just a script - like in your case because your files are written using commonjs. And this makes rollup-plugin-commonjs
to think that what it receives is already a module and it skips transforming it altogether, so it just leaves your module.exports
and such intact.
In this particular case, you can reorder your plugins - put rollup-plugin-commonjs
before @rollup/plugin-inject
so a commonjs plugin can make its magic first and transform your scripts to modules.
from plugins.
Thank you for the proposed workaround @Andarist.
It resolves the problem in the context of this repro (In my real codebase I remember having hit another issue when changing plugin order. I'll let you know here if I hit it again)
I updated repository's testcase in the meantime.
from plugins.
I'm also experiencing it. Hopefully it can be addressed.
from plugins.
Related Issues (20)
- [!] Error: Unexpected token (Note that you need plugins to import files that are not JavaScript)
- [typescript] default `include` pattern excludes .js, .jsx files even if `allowJs` is set
- [@rollup/plugin-typescript] Generated code not processed
- Miss Transform Hook, leads to the failure of compiling Vue single-file components
- No way to get this working, Debian 12
- constructor var name or function parameters are ending up with the same name as the class HOT 1
- Infinite loop in combination with virtual module and missing package.json
- [@rollup/plugin-esm-shim] Import regex fails if the the code contains an "import" string followed by more content HOT 1
- Typescript plugin throws an error when importing relative imports outside of the current working directory...even with `filterRoot` set
- Typescript plugin behaves differently depending on whether the `include` option is a string or a regular expression HOT 1
- Typescript plugin fails to compile the entry point when there is at least one invalid TypeScript file somewhere is the working directory HOT 1
- node-resolve: allow more granular config of preferBuiltins HOT 1
- [TypeScript] TypeScript plugin seems to be watching files and trigerring builds by itself
- Terser plugin generates duplicate imports with `preserveModules` and `mangle` and `nameCache`
- [TypeScript] Module resolution doesn't work in rollup.config.ts when using modern project settings HOT 3
- [TypeScript] Include "js", "mjs", "cjs" and "json" in default `includes` HOT 1
- Collision of mangled properties in subclass and superclass residing in different chunks
- export { terser as default } in dist
- Typescript plugin transformers API design is incompatible with angular compiler HOT 1
- I found a conflict between the descriptions on GitHub and the official website(rollupjs.org)
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 plugins.