-
Notifications
You must be signed in to change notification settings - Fork 673
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pluginBuilder dependencies being built #289
Comments
Is this the same as #228? If so, then I would prefer to just keep the conversation in that ticket since it has more history. Not saying it will get solved, but we can reopen to consider more. If you want to take a look at a patch, that would probably help move it forward. |
@jrburke thanks for the quick response. It is actually different to #228. #228 was caused by using a pluginBuilder as a dependency as well, causing the pluginBuilder to fail. It could still be worth including a doc note about this with pluginBuilders. The issue here is pluginBuilder dependencies being detected as module dependencies that need writing. It's not a major issue as an excludeShallow fixes it, but it is important to get right at some point. Great, I will dive in when I have the time, but I'm not massively prioritising it for the moment though. |
OK, so the issue is the pluginModule has a dependency on module 'a', but the regular plugin does not depend on 'a', and nothing else in the build depends on 'a', but 'a' ends up in the build output. Workaround is to use an excludeShallow for 'a'. |
Yes, exactly. |
I just wanted to bump this - it's a long standing issue on Require LESS (https://github.com/guybedford/require-less#builds), and affects all plugins made with the amd-loader builder. Is there a path to a fix? Any clues would be appreciated for a pull request. |
This one is a bit tricky, as it would require keeping a separate dependency tree for the plugin, and for the builder, and attaching the plugin's dependency tree to the build output, while keeping the pluginBuilder separate. Perhaps the pluginBuilder could be loaded in a separate context. It may take some work though, as we need to perserve the config used from the main build context. The work would be done in build/jslib/requirePatch.js. |
This is exactly what I'd need for a plugin builder that has to pre-compile a client-side template language to JS functions as well. Currently I'm stuck with a manually cobbled together solution that hacks into some of the require and r.js internals to get it done, but it's ugly (and somewhat brittle). Really would appreciate a decent official solution. |
@rjgotten if you are using a pluginBuilder, then it should be enough to then just do an exclude: [] for any of the pluginBuilder dependencies that end up in the layer, hacking internals should not be required. While it would be nice to avoid that exclusion pattern, that is the best pathway with the existing code. |
@jrburke |
+1 |
I have a different problem, but it sounds like using a separate context for the pluginBuilder might resolve it as well. It looks like relative URLs are being resolved in relation to the build's In my case, I'm trying to use {
baseUrl: 'client',
appDir: 'src',
paths: {
jquery: '../../bower_components/jquery/dist/jquery',
// AMD loader plugins
jade: '../../bower_components/require-jade/jade',
css: '../../bower_components/require-css/css',
// Temporary fix to ensure that the CSS plugins internal modules are
// loaded correctly.
'css-builder': '../../bower_components/require-css/css-builder',
normalize: '../../bower_components/require-css/normalize',
},
mainConfigFile: 'src/client/scripts/amd-config.js',
dir: 'out',
optimize: 'none',
pragmasOnSave: {
excludeJade: true
},
modules: [/* ... */]
} |
@jugglinmike for that case it sounds like using package config for require-css may work better. |
@jrburke That did the trick. Now I understand the behavior of the package config--thanks! |
@jugglinmike Life-and-last-lost-hour saver! |
@miraclebg Glad it helped! |
Can you explain how using package config solved this issue? |
|
I'm still stuck with these same issues affecting require-less as a plugin that builds on top of require-css. It has a pluginBuilder, which requires the require-css pluginBuilder. This results in that pluginBuilder being built in.
Perhaps pluginBuilder loads can happen in a fresh / hidden context for the builds to avoid this?
The text was updated successfully, but these errors were encountered: