Skip to content
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

Using the require option #339

Open
rjbergerud opened this issue Jul 10, 2015 · 2 comments
Open

Using the require option #339

rjbergerud opened this issue Jul 10, 2015 · 2 comments

Comments

@rjbergerud
Copy link

I'm wondering if someone can post an example of using this options. While in browserify, this runs fine:
browserify -r ./public/js/productionJS/recommendationConcatFooter.js:selector > ./public/js/productionJS/recommendationFooter.js

but in my gruntfile,

footer: {
                src: ['public/js/productionJS/recommendationConcatFooter.js'],
                dest: 'public/js/productionJS/recommendationFooter.js',
                options: {
                    debug: true,
                    require: ['./public/js/productionJS/recommendationConcatFooter.js:selector']

                }
            }

doesn't return any errors when I run grunt, but when I go to include the module selector in a script tag, I get a 'can't find module selector' error.

@tleunen
Copy link
Collaborator

tleunen commented Jul 23, 2015

Remove the file from your src.
Just keep src: []

@HenriqueSilverio
Copy link

To generate a separate bundle for project libraries, I do this:

plugins: {
  options: {
    debug: true,
    require: [
      'jquery',
      'underscore',
      'backbone',
      'backbone.marionette'
    ]
  },

  files: {
    '<%= paths.dist.base %>/plugins.js': []
  }
}

Apparently, it works fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants