google / google/closure-compiler

IIFE isolation_mode does not work for chunks

Open
#3,464 1 comment 1 reaction 0 assignees View on GitHub
Dominant language
JavaScript
Stars
7.7k
Forks
1.2k
Avg merge
2d 12h
Merged PRs (30d)
6

Description

I think `--isolation_mode IIFE` should have the same effect on chunks as on output files. Otherwise chunks pollute the _window_ namespace.

```js
console.log('hello world')
```

```console
java -jar compiler.jar \
--compilation_level ADVANCED \
--isolation_mode IIFE \
--js t.js \
--chunk mychunk:auto \
```

```js
// mychunk.js
console.log("hello world");

```

Although then it's not clear then how one chunk could use data from the dependency chunk... unless via google's module loading irc

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.