-
Notifications
You must be signed in to change notification settings - Fork 3
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
Support for Directory Alias in RequireJS Modules #31
Comments
Now the CSS-is supported, but HBS are not. Also paths like https://github.com/Anachron/satisfy/blob/master/assets/javascripts/common.coffee paths:
...
# Folders
'j': '../javascripts'
'c': '../stylesheets'
't': '../templates/' define [
'backbone',
'backbone.marionette',
'jquery',
'hbs!t/app/items/Todo',
'css!c/app/Todo'
], (Backbone, Marionette, $, TodoTemplate) ->
TodoItemView = Marionette.ItemView.extend({
'template': TodoTemplate,
'events': {
'click label': "toggleDone"
},
toggleDone: () ->
$(@el).find('.checkbox').toggleClass('done')
}) work, but they still throw errors. also the baseUrl: '../'
...
'paths':
'j': 'javascripts'
'c': 'stylesheets'
't': 'templates' Instead of hardly changing the code, I would love to have another option to provide a simple adapter in the require:
'modules':
'css':
'extension': 'css'
'check': true #Either a function or boolean (true = internal search, false = no path validation, function = custom path validation)
'hbs':
'extension': 'hbs'
'check': true Add support for various plugins and have a short list for the known ones, how to implement them 👍 |
Afraid that doesn't make much sense. Instead of supporting it, make people write their own support? I hope to get to this before Monday. |
Thanks for your feedback! If you need any more information, please let me know. |
@Anachron could you put together a branch of satisfy where you have the require.js config the way you want it? Forget that mimosa-require gets angry with you. Just get the app working with require.js. Looking into the |
@dbashford basically, it's like in my setup above. Set But if it will help you I will be glad to create a fork. But I will take a nap first 😪 |
Working on this now. Have it fixed, but want to do a bit more to allow something closer to what you were asking for (ability to configure plugins and extensions for them). Expect it maybe tonight, possibly tomorrow. |
Thanks, that's good News. Need any more information? |
Nope, I'm good. =) |
This is where I'll end up in terms of config. The This will require some documentation which needs to get done before the upgraded mimosa-require finds its way into mimosa. That might not happen until tomorrow. But I'll get the new mimosa-require published today. verify: # settings for requirejs path verification
enabled: true # Whether or not to perform verification
plugins: # config for plugins. mimosa-require will verify plugin paths that
# are listed as dependencies. It does not keep track of plugins
# otherwise.
css:"css" # these are the built-in default plugins. The key is the name of the
hbs:"hbs" # plugin, the value before the !, and the value is the extension used
# for those files. If you update this setting to add a new plugin,
# consider opening a mimosa-require issue to make that plugin another
# default. |
That's great, it's more simple and I really like it. |
Pushed mimosa |
I am afraid this isn't fixed:
I pushed the latest version of satisfy for you: There are no errors in the console. If you uncomment this: |
I get the following errors only
This is broken because you need to use
This is broken because its just a bad path.
This is broken because you need to use
This is broken because, as I discussed in the issue I opened on your repo,
And this doesn't work because you need to use
|
Turns out I had old files that had not been cleaned in public directory. After cleaning and another compilation all works well. Thanks! |
Modules like
'css!c/app/test'
will throw an error, even if'c'
is defined as short path for the stylesheet directory. The app thinks c is the name of the folder instead of replacing it with the actual path set.The text was updated successfully, but these errors were encountered: