Comments (2)
Right, I have hit this too, and it is a bit tricky to fix. Normally dependencies are not completely evaluated, the AST parser just pulls out the name, module dependencies and evaluates that for the module. This is important since some modules may depend on browser-specific, or env-specific variables (like window or document). However, for plugins, it does evaluate the whole file. But the system only knows it is a plugin if the name has been used as part of plugin resource.
What I need to do is allow a module definition to be "reset" if already defined when it is later seen as a plugin, or used as a plugin dependency. However, that can be tricky to know (ideally if 'text' had dependencies, those would be completely evaluated). I think it may work out given the synchronous nature of module loading in the optimizer, but it will require some fancier bookkeeping and module reset logic.
I have already hit a few cases where it would be nice to reuse the text plugin as a basis for other plugins (like the coffeescript plugin), but I ended up inlining the text plugin work in the other plugin to get around the limitation outlined in this issue. So I definitely see the usefulness of supporting it, it just make take a bit of time to sort out.
As a hack, if you specify a text resource first in the build dependencies for a layer, before the above plugin is used, then it may work out.
from r.js.
This should now be fixed in the the latest code. Try this snapshot.
from r.js.
Related Issues (20)
- How to use requirejs optimizer to create Module specific code chunk instead of big single file for Backbone project? HOT 3
- Wrong relative path for module-create in source map HOT 1
- Java/JSS 10 build error HOT 3
- Cannot use functions for out and onModuleBundleComplete simultaneously
- Any plans for supporting ES2017+ in uglify/minify? HOT 1
- ES6 Object Spread syntax not work HOT 4
- [QUESTION] Where I can find the CI service? HOT 1
- TypeError: Cannot read property 'type' of undefined HOT 4
- r js stops loading dependecies of module when i use specific module name for that file. HOT 1
- Unexpected token ... HOT 12
- preserveLicenseComments should do its best to not add multiple identical licenses from the same project. HOT 2
- This is not an issue and should be removed
- Define Incorrectly Updated When No Dependencies And Function Wrapped In Parentheses
- Bundaling ES class with static field lead to [Error: Line 5: Unexpected token =] HOT 1
- Unable to concatenate all module to single file HOT 1
- Has insecure URLs (ESLint error: no-insecure-url)
- Add a security policy HOT 4
- Can I transpile a commonjs AST from rollup watch with some code from here?
- e.getLayout is not a function after upgrading to requirejs 2.3.6
- Prototype Pollution Vulnerability Affecting [email protected] module HOT 1
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 r.js.