Closed matthewp closed 7 years ago
@m-mujica any plan of fixing this bug? do you need a example app?
@pYr0x I haven't looked at this. I'll try to get some time before end of week to fix it. I'll let you know if I run into issues replicating the bug.
@pYr0x I just published steal-conditional@0.3.5 with the fix, I did a small example to replicate your issue and it build correctly with 0.3.5
Please give it a try when you have some time and let me know if you run into any issue.
@pYr0x commented on Tue May 16 2017
i used the steal-conditional boolean syntax to load a module.
require("~/modules/notice-box#?triwala-vk/modules/notice-box-exists");
reduce the
notice-box-exists
to the basic the module looks like this:when i create a production version i get this error the problem is "jquery" but i dont know why. @m-mujica any idea why jquery cause an error in steal-conditional if i import a module that does not use jquery i works.
import '~/util/url';
url.js@pYr0x commented on Tue May 16 2017
i found out that
module.exports = !!window.document.querySelector('.notice-box');
is not working too.window
is not defined. is the problem that while build, the loader is using node and there is not window object present?@m-mujica commented on Tue May 16 2017
@pYr0x are you using the latest version of steal-conditional?
steal-conditional should not eval your condition module (
notice-box-exists
) during the buildSee https://github.com/stealjs/steal-conditional/blob/68283fd641bf97aa969946576fd6c4a05ae0d1cc/conditional.js#L323-L327
I'll try to replicate the
jquery
issue.@m-mujica commented on Tue May 16 2017
@pYr0x in this case, since you're using the boolean syntax, steal-conditional should make a bundle of
~/modules/notice-box
. https://github.com/stealjs/steal-conditional/blob/68283fd641bf97aa969946576fd6c4a05ae0d1cc/conditional.js#L259@pYr0x commented on Tue May 16 2017
@m-mujica i used "steal-conditional": "^0.3.2"
notice-box
is bundled into a file calledindex-form-index-bd4d57f2.js
andnotice-box-exists
is also bundled into a fileand if i use a console.log in the module
notice-box-exists
the output is shown during the build. so the module will be eval during build