@putout/bundle 1.3.0 → 1.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # @putout/bundle [![NPM version][NPMIMGURL]][NPMURL]
2
2
 
3
- [NPMIMGURL]: https://img.shields.io/npm/v/@putout/plugin-remove-debugger.svg?style=flat&longCache=true
4
- [NPMURL]: https://npmjs.org/package/@putout/plugin-remove-debugger "npm"
3
+ [NPMIMGURL]: https://img.shields.io/npm/v/@putout/bundle.svg?style=flat&longCache=true
4
+ [NPMURL]: https://npmjs.org/package/@putout/bundle "npm"
5
5
 
6
6
  🐊[**Putout**](https://github.com/coderaiser/putout) bundle to get things working in [**Deno**](https://deno.land) and **Browsers** using amazing [esm.sh](https://esm.sh).
7
7
 
@@ -45,6 +45,14 @@ console.log(putout('compare(a, b)', {
45
45
  });
46
46
  ```
47
47
 
48
+ ## IIFE
49
+
50
+ When you want to access `putout` from global scope using `script` tag, use:
51
+
52
+ ```html
53
+ <script src="https://cdn.jsdelivr.net/npm/@putout/bundle@1/bundle/putout-iife.js"></script>
54
+ ```
55
+
48
56
  ## License
49
57
 
50
58
  MIT
@@ -268,7 +268,12 @@ function requireGenerateCode () {
268
268
  } = node;
269
269
 
270
270
  if (path.isStringLiteral() && /^__[a-z]$/.test(value)) {
271
- path.node.value = getVar(value);
271
+ path.node.value = getVar(name);
272
+ return;
273
+ }
274
+
275
+ if (/^__identifier__[a-z]$/.test(name)) {
276
+ path.node.name = getVar(name);
272
277
  return;
273
278
  }
274
279
 
@@ -3270,8 +3275,8 @@ var rules = lib.rules = {
3270
3275
 
3271
3276
  var pluginPutout = /*#__PURE__*/_mergeNamespaces({
3272
3277
  __proto__: null,
3273
- rules: rules,
3274
- 'default': lib
3278
+ default: lib,
3279
+ rules: rules
3275
3280
  }, [lib]);
3276
3281
 
3277
3282
  export { pluginPutout as default };