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

error in section output.globals #2541

Closed
1 of 4 tasks
LongTengDao opened this issue Nov 1, 2018 · 0 comments
Closed
1 of 4 tasks

error in section output.globals #2541

LongTengDao opened this issue Nov 1, 2018 · 0 comments

Comments

@LongTengDao
Copy link
Contributor

LongTengDao commented Nov 1, 2018

Documentation Is:

  • Missing
  • Needed
  • Confusing
  • Not Sure?

Please Explain in Detail...

https://github.com/rollup/rollup/blame/master/docs/999-big-list-of-options.md#L144 has error:

144 }(window.jQuery));

it should be (according to my experiment and the context of the doc):

144 }(window.$));

Your Proposal for Changes

change like above, or, I think it will be better to change the lines 125 & 136 & 153 than line 144, like this:

117 #### output.globals *`-g`/`--globals`*
118 
119 `Object` of `id: name` pairs, used for `umd`/`iife` bundles. For example, in a case like this...
120 
121 ```js
122 import $ from 'jquery';
123 ```
124 
125 ...we want to tell Rollup that the `jquery` module ID equates to the global `jQuery` variable:
126 
127 ```js
128 // rollup.config.js
129 export default {
130   ...,
131  external: ['jquery'],
132   output: {
133     format: 'iife',
134     name: 'MyBundle',
135     globals: {
136       jquery: 'jQuery'
137     }
138   }
139 };
140 
141 /*
142 var MyBundle = (function ($) {
143   // code goes here
144 }(window.jQuery));
145 */
146 ```
147 
148 Alternatively, supply a function that will turn an external module ID into a global.
149 
150 When given as a command line argument, it should be a comma-separated list of `id:name` pairs:
151 
152 ```bash
153 rollup -i src/main.js ... -g jquery:jQuery,underscore:_
154 ```
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

1 participant